forked from friendica/friendica-addons
add anotehr check
This commit is contained in:
parent
e29060c438
commit
05c37f3156
|
@ -210,6 +210,9 @@ function retriever_tidy() {
|
||||||
DBA::delete('retriever_resource', ['completed IS NULL AND created < DATE_SUB(now(), INTERVAL 3 MONTH)']);
|
DBA::delete('retriever_resource', ['completed IS NULL AND created < DATE_SUB(now(), INTERVAL 3 MONTH)']);
|
||||||
|
|
||||||
$r = DBA::p("SELECT retriever_item.id FROM retriever_item LEFT OUTER JOIN retriever_resource ON (retriever_item.resource = retriever_resource.id) WHERE retriever_resource.id is null");
|
$r = DBA::p("SELECT retriever_item.id FROM retriever_item LEFT OUTER JOIN retriever_resource ON (retriever_item.resource = retriever_resource.id) WHERE retriever_resource.id is null");
|
||||||
|
if (!DBA::isResult($r)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Logger::info('retriever_tidy: found ' . count($r) . ' retriever_items with no retriever_resource');
|
Logger::info('retriever_tidy: found ' . count($r) . ' retriever_items with no retriever_resource');
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
DBA::e('DELETE FROM retriever_item WHERE id = %d', intval($rr['id']));
|
DBA::e('DELETE FROM retriever_item WHERE id = %d', intval($rr['id']));
|
||||||
|
|
Loading…
Reference in a new issue