Пример #1
0
 /**
  * Execute the console command.
  *
  * @param \Malezha\MessageSender\Contracts\MessageQueue $messageQueue
  * @return void
  */
 public function handle(MessageQueue $messageQueue)
 {
     $queues = $messageQueue->select('message_sender_queues.*')->leftJoin('message_sender_events', 'message_sender_events.id', '=', 'message_sender_queues.event_id')->where('message_sender_queues.status', 'pending')->whereIn('message_sender_events.sending_time', ['now', date('ymdHi')])->get();
     foreach ($queues as $queue) {
         $this->dispatch(new $queue->provider($queue));
     }
 }
Пример #2
0
 /**
  * Failed job
  *
  * @return void
  */
 public function failed()
 {
     $this->messageQueue->status = 'failed';
     $this->messageQueue->save();
 }