improvements

This commit is contained in:
Matthew Exon 2022-03-02 22:19:00 +01:00
parent af23ecf94f
commit f582ba89bd
2 changed files with 2 additions and 1 deletions

View file

@ -206,6 +206,7 @@ function phototrack_search_table($a, $table) {
}
}
$r = DBA::p("SELECT COUNT(*) FROM `$table` LEFT OUTER JOIN phototrack_row_check ON ( phototrack_row_check.`table` = '$table' AND phototrack_row_check.`row-id` = `$table`.id ) WHERE ( ( phototrack_row_check.checked IS NULL ) OR ( phototrack_row_check.checked < DATE_SUB(NOW(), INTERVAL 1 MONTH) ) )");
Logger::info("@@@ phototrack_search_table " . print_r(DBA::fetch($r)));
$remaining = DBA::fetch($r)['count'];
Logger::info('phototrack: searched ' . DBA::numRows($rows) . ' rows in table ' . $table . ', ' . $remaining . ' still remaining to search');
return $remaining;

View file

@ -215,7 +215,7 @@ function retriever_tidy() {
}
Logger::info('retriever_tidy: found ' . DBA::numRows($r) . ' retriever_items with no retriever_resource');
while ($rr = DBA::fetch($r)) {
DBA::e('DELETE FROM retriever_item WHERE id = %d', intval($rr['id']));
DBA::delete('retriever_item', ['id' => intval($rr['id'])]);
}
}