wa0x6e / php-resque-ex-scheduler

An addon for php-resque that lets you queue jobs for execution some time in the future. Follows resque-scheduler.
MIT License
26 stars 24 forks source link

getDelayedTimestampSize refers to wrong function #13

Open HMAZonderland opened 9 years ago

HMAZonderland commented 9 years ago
/**
 * Get the number of jobs for a given timestamp in the delayed schedule.
 *
 * @param  DateTime|int $timestamp Timestamp
 * @return int          Number of scheduled jobs.
 */
public static function getDelayedTimestampSize($timestamp)
{
    $timestamp = self::toTimestamp($timestamp);

    return \Resque::redis()->llen(self::QUEUE_NAME . ':' . $timestamp, $timestamp);
}

The first line of this functions will go wrong, this has to be:

$timestamp = self::getTimestamp($timestamp);
HMAZonderland commented 9 years ago

Also the function used to return the value isn't up to date anymore. I guess Redis was updated in between?

return \Resque::redis()->llen(self::QUEUE_NAME . ':' . $timestamp);

instead of

return \Resque::redis()->llen(self::QUEUE_NAME . ':' . $timestamp, $timestamp);