Cronario\Queue::deleteJob PHP Method

deleteJob() public method

public deleteJob ( $id ) : boolean
$id
return boolean
    public function deleteJob($id)
    {
        $payload = $this->getPayload($id);
        if (!in_array($payload[self::JOB_PAYLOAD_STATE], [self::STATE_RESERVED, self::STATE_BURIED])) {
            return true;
        }
        $keyBuried = $this->getKeyBuried($payload[self::JOB_PAYLOAD_QUEUE]);
        $keyReserved = $this->getKeyReserved($payload[self::JOB_PAYLOAD_QUEUE]);
        $redisJobNamespace = $this->getRedisJobNamespace();
        $result = $this->getRedis()->transaction(function ($tx) use($id, $keyBuried, $keyReserved, $redisJobNamespace) {
            /** @var $tx \Predis\Client */
            $tx->zrem($keyReserved, $id);
            $tx->zrem($keyBuried, $id);
            $tx->hdel($redisJobNamespace, $id);
        });
        return array_count_values($result) >= 1;
    }