Fixing time
This commit is contained in:
parent
82f543a587
commit
68d37f6db8
1 changed files with 5 additions and 2 deletions
|
@ -47,20 +47,23 @@ class RunMonitoring extends Command
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
$n = DB::select('select now()');
|
||||||
|
dd($n);
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$rounds = $this->argument('rounds') ?? $this->rounds;
|
$rounds = $this->argument('rounds') ?? $this->rounds;
|
||||||
|
|
||||||
// Getting pending tasks
|
// Getting pending tasks
|
||||||
$tasks = DB::table('tasks')
|
$tasks = DB::table('tasks')
|
||||||
->where(function($query) {
|
->where(function($query) {
|
||||||
$query->whereRaw('DATE_SUB('.time().', INTERVAL frequency SECOND) > last_execution');
|
$query->whereRaw('DATE_SUB(NOW(), INTERVAL frequency SECOND) > last_execution');
|
||||||
$query->orWhereNull('last_execution');
|
$query->orWhereNull('last_execution');
|
||||||
})
|
})
|
||||||
->where('active', 1)
|
->where('active', 1)
|
||||||
->orderBy('last_execution', 'ASC')
|
->orderBy('last_execution', 'ASC')
|
||||||
->take($rounds)
|
->take($rounds)
|
||||||
->get()
|
//->get()
|
||||||
;
|
;
|
||||||
|
dd($tasks->toSql());
|
||||||
|
|
||||||
if (is_null($tasks) || count($tasks) == 0) {
|
if (is_null($tasks) || count($tasks) == 0) {
|
||||||
$this->info('No task to process, going back to sleep');
|
$this->info('No task to process, going back to sleep');
|
||||||
|
|
Loading…
Add table
Reference in a new issue