Skip to content

Commit

Permalink
Fix typo.
Browse files Browse the repository at this point in the history
Fix typo in url, also fix derpness where script
would always succeed even though every curl request failed.
  • Loading branch information
markstory committed May 20, 2012
1 parent 40591d9 commit c1640cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/populate_search_index.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function updateIndex($lang, $file) {
$id = str_replace('/', '-', $id);
$id = trim($id, '-');

$url = implode('/', array(ES_URL, ES_INDEX, CAKEPHP_VERSION . '-' . $lang, $id));
$url = implode('/', array(ES_HOST, ES_INDEX, CAKEPHP_VERSION . '-' . $lang, $id));

$data = array(
'contents' => $fileData['contents'],
Expand All @@ -69,7 +69,7 @@ function updateIndex($lang, $file) {
$response = curl_exec($ch);
$metadata = curl_getinfo($ch);

if ($metadata['http_code'] > 400) {
if ($metadata['http_code'] > 400 || !$metadata['http_code']) {
echo "[ERROR] Failed to complete request.\n";
var_dump($response);
exit(2);
Expand Down

0 comments on commit c1640cb

Please sign in to comment.