Permalink
Browse files

Fix typo.

Fix typo in url, also fix derpness where script
would always succeed even though every curl request failed.
  • Loading branch information...
1 parent 40591d9 commit c1640cbd1fd29715d452e79551f379a4796aea79 @markstory markstory committed May 20, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 scripts/populate_search_index.php
@@ -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'],
@@ -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);

0 comments on commit c1640cb

Please sign in to comment.