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:
parent
d104d3e51c
commit
fe2ad3edd8
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user