php-resque-ex-scheduler icon indicating copy to clipboard operation
php-resque-ex-scheduler copied to clipboard

getDelayedTimestampSize refers to wrong function

Open HMAZonderland opened this issue 9 years ago • 1 comments

/**
 * 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 avatar May 18 '15 12:05 HMAZonderland

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);

HMAZonderland avatar May 18 '15 12:05 HMAZonderland