/** * */ public function fire() { $jobid = $this->argument('job_id'); if (empty($jobid)) { $item = Job::where('status', '!=', Job::STATUS_FINISHED)->orderBy('available_at', 'asc')->first(); if (count($item) < 1) { $this->info("Queue is empty."); } } else { $item = Job::findOrFail($this->argument('job_id')); } if (count($item) > 0) { $job = new QdbJob(app(), $item); $job->fire(); } if ($this->option('stats')) { $this->info($this->getStats()); } }
protected function getQdbJob() { $this->activeJob = \Veer\Services\Queuedb\Job::where('status', '<=', '1')->where('available_at', '<=', date('Y-m-d H:i:00', time()))->orderBy('available_at', 'asc')->first(); return $this->activeJob; }
public function unpauseJob() { \Veer\Services\Queuedb\Job::where('id', '=', head(array_keys($this->actionUnpause)))->update(['status' => \Veer\Services\Queuedb\Job::STATUS_OPEN]); $this->actionUnpause = null; }