Example #1
0
 protected function fetchQue()
 {
     $que = FVSyncQue::find($this->option('id'));
     if (NULL === $que) {
         throw new \Exception("Not found with given id {$this->option('id')}");
     }
     if (FVSyncType::ID_LIST !== $que->type_id) {
         throw new \Exception('Unvalid Que type!');
     }
     return $que;
 }
Example #2
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $ques = FVSyncQue::where('updated_at', '<=', Carbon::now()->subHours(self::SUBHOURS))->whereIn('status_code', [FVSyncQue::STATUS_INIT, FVSyncQue::STATUS_WRITING, FVSyncQue::STATUS_IMPORTING])->get();
     return 0 === $ques->count() ? NULL : $this->notify($ques);
 }
Example #3
0
 public function hasProcessingQue()
 {
     $num = FVSyncQue::where('type_id', '=', FVSyncType::where('name', '=', $this->getType())->first()->id)->whereIn('status_code', [FVSyncQue::STATUS_WRITING, FVSyncQue::STATUS_IMPORTING])->count();
     return 0 < $num;
 }
Example #4
0
 protected function fetchDelayQue()
 {
     return FVSyncQue::delay()->first();
 }
Example #5
0
 public function show(FVSyncQue $que)
 {
     pr($que->getAttributes());
     pr($que->conditions);
 }