Replace cron/worker "last" config entries with key-value entries
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user