/** * Handle delayed items for the next scheduled timestamp. * * Searches for any items that are due to be scheduled in Resque * and adds them to the appropriate job queue in Resque. * * @param DateTime|int $timestamp Search for any items up to this timestamp to schedule. */ public function handleDelayedItems($timestamp = null) { while (($timestamp = ResqueScheduler::nextDelayedTimestamp($timestamp)) !== false) { $this->updateProcLine('Processing Delayed Items'); $this->enqueueDelayedItemsForTimestamp($timestamp); } }
/** * Handle delayed items for the next scheduled timestamp. * * Searches for any items that are due to be scheduled in Resque * and adds them to the appropriate job queue in Resque. * * @param DateTime|int $timestamp Search for any items up to this timestamp to schedule. */ public function handleDelayedItems($timestamp = null) { while (($timestamp = ResqueScheduler::nextDelayedTimestamp($timestamp)) !== false) { // custom conditional added as to switch between global status behaviours $globalStatus = $this->getResqueRedis()->get('config:globalStatus'); if ($globalStatus) { //enqueue job $this->updateProcLine('Processing Delayed Items'); $this->enqueueDelayedItemsForTimestamp($timestamp); } else { //further delay job $this->updateProcLine('Skipping Delayed Items'); $this->skipDelayedItemsForTimestamp($timestamp); } } }