Replace cron/worker "last" config entries with key-value entries

This commit is contained in:
Philipp 2022-12-29 20:30:19 +01:00
parent 10f8631cd9
commit 6b3265742a
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
6 changed files with 25 additions and 17 deletions

View file

@ -1148,11 +1148,19 @@ function update_1502()
function update_1505()
{
$postUpdateEntries = DBA::selectToArray('config', ['k', 'v'], ["`k` LIKE ?", "post_update_%"]);
$conditions = [
"(`k` LIKE ?) OR (`k` = ?) OR (`cat` = ? AND `k` LIKE ?)",
"post_update_%",
"worker_last_cleaned",
"system",
"last%"
];
$postUpdateEntries = DBA::selectToArray('config', ['k', 'v'], $conditions);
foreach ($postUpdateEntries as $postUpdateEntry) {
DI::keyValue()->set($postUpdateEntry['k'], $postUpdateEntry['v']);
}
return DBA::delete('config', ["`k` LIKE ?", "post_update_%"]) ? Update::SUCCESS : Update::FAILED;
return DBA::delete('config', $conditions) ? Update::SUCCESS : Update::FAILED;
}