1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00

Fixes for multidb Task Scheduler

This commit is contained in:
David Bomba 2023-01-23 07:41:27 +11:00
parent d104d3e51c
commit fe2ad3edd8

View File

@ -42,6 +42,23 @@ class TaskScheduler implements ShouldQueue
*/
public function handle()
{
if (! config('ninja.db.multi_db_enabled')) {
Scheduler::with('company')
->where('is_paused', false)
->where('is_deleted', false)
->whereNotNull('next_run')
->where('next_run', '<=', now())
->cursor()
->each(function ($scheduler) {
$this->doJob($scheduler);
});
return;
}
foreach (MultiDB::$dbs as $db) {
MultiDB::setDB($db);