mirror of
https://github.com/YGGverse/Yo.git
synced 2025-03-13 05:41:18 +00:00
delete deprecated documents with HTTP code not 200 on second scan
This commit is contained in:
parent
17d6171d95
commit
93baed4b90
@ -178,6 +178,16 @@ foreach($index->search('')
|
|||||||
// Update HTTP code or skip on empty
|
// Update HTTP code or skip on empty
|
||||||
if ($code = curl_getinfo($request, CURLINFO_HTTP_CODE))
|
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;
|
$data['code'] = $code;
|
||||||
|
|
||||||
} else continue;
|
} else continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user