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
6 changed files with 25 additions and 17 deletions

View File

@@ -45,7 +45,7 @@ class PullDirectory
return;
}
$now = (int)DI::config()->get('system', 'last-directory-sync', 0);
$now = (int)(DI::keyValue()->get('last-directory-sync') ?? 0);
Logger::info('Synchronization started.', ['now' => $now, 'directory' => $directory]);
@@ -64,7 +64,7 @@ class PullDirectory
$result = Contact::addByUrls($contacts['results']);
$now = $contacts['now'] ?? 0;
DI::config()->set('system', 'last-directory-sync', $now);
DI::keyValue()->set('last-directory-sync', $now);
Logger::info('Synchronization ended', ['now' => $now, 'count' => $result['count'], 'added' => $result['added'], 'updated' => $result['updated'], 'unchanged' => $result['unchanged'], 'directory' => $directory]);
}