/**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $task_id = $this->argument('task_id');
     $task = Task::find($task_id);
     $task->is_running = 0;
     $task->save();
     $manager = new TaskManager($task);
     $manager->unlock();
 }
Exemple #2
0
 public function fire()
 {
     $manager = new TaskManager(Task::findOrFail($this->argument('task_id')));
     if (!$this->option('bg')) {
         //$this->info( 'Running without bg' );
         $manager->run($this);
     } else {
         //$this->info( 'Running in bg' );
         $manager->runInBackground();
     }
 }
 public function unlock($task)
 {
     $cmd = new TaskManager($task);
     $cmd->unlock();
     return json_encode(['status' => 'unlocked']);
 }
 public function fire()
 {
     $task_id = $this->argument('task_id');
     $cmd = new TaskManager(Task::findOrFail($task_id));
     $cmd->stop();
 }