Ejemplo n.º 1
0
 /**
  * 
  */
 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());
     }
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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;
 }