Move DB queries into jobs, so that the scheduler and artisan command calls doesnt evaluate them until the job is actually run
This commit is contained in:
@@ -34,11 +34,11 @@ class BroadbandTraffic extends Command
|
||||
if ($this->option('supplier')) {
|
||||
$o = Supplier::where('name','like',$this->option('supplier'))->singleOrFail();
|
||||
|
||||
Job::dispatchSync($o);
|
||||
Job::dispatchSync($o->id);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (Supplier::active()->get() as $o)
|
||||
Job::dispatchSync($o);
|
||||
Job::dispatchSync($o->id);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user