mirror of
https://github.com/YGGverse/Yo.git
synced 2026-03-31 17:55:35 +00:00
delete deprecated documents with HTTP code not 200 on second scan
This commit is contained in:
parent
17d6171d95
commit
93baed4b90
1 changed files with 10 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue