Browse Source

delete deprecated documents with HTTP code not 200 on second scan

main
ghost 1 year ago
parent
commit
93baed4b90
  1. 10
      src/cli/document/crawl.php

10
src/cli/document/crawl.php

@ -178,6 +178,16 @@ foreach($index->search('') @@ -178,6 +178,16 @@ foreach($index->search('')
// Update HTTP code or skip on empty
if ($code = curl_getinfo($request, CURLINFO_HTTP_CODE))
{
// Delete deprecated document from index as HTTP code still not 200
if ($code != 200 && !empty($data['code']) && $data['code'] != 200)
{
$index->deleteDocument(
$document->getId()
);
continue;
}
$data['code'] = $code;
} else continue;

Loading…
Cancel
Save