Update composer

This commit is contained in:
Daniel Mason 2022-02-08 19:08:07 +13:00
parent 80d64e79ff
commit dd0bb8947f
16 changed files with 152 additions and 143 deletions

View file

@ -12,5 +12,4 @@ namespace Resque;
class Exception extends \Exception
{
}

View file

@ -11,5 +11,4 @@ namespace Resque\Job;
*/
class DirtyExitException extends \RuntimeException
{
}

View file

@ -11,5 +11,4 @@ namespace Resque\Job;
*/
class DontCreate extends \Exception
{
}

View file

@ -11,5 +11,4 @@ namespace Resque\Job;
*/
class DontPerform extends \Exception
{
}

View file

@ -11,7 +11,6 @@ namespace Resque\Job;
*/
class Factory implements FactoryInterface
{
/**
* @param $className
* @param array $args

View file

@ -59,6 +59,7 @@ class Job
* @param string $id Unique identifier for tracking the job. Generated if not supplied.
*
* @return string
*
* @throws \InvalidArgumentException
*/
public static function create($queue, $class, $args = null, $monitor = false, $id = null)
@ -91,6 +92,7 @@ class Job
* instance of \Resque\Job\Job for it.
*
* @param string $queue The name of the queue to check for a job in.
*
* @return false|object Null when there aren't any waiting jobs, instance of \Resque\Job\Job when a job was found.
*/
public static function reserve($queue)
@ -109,6 +111,7 @@ class Job
*
* @param array $queues
* @param int $timeout
*
* @return false|object Null when there aren't any waiting jobs, instance of \Resque\Job\Job when a job was found.
*/
public static function reserveBlocking(array $queues, $timeout = null)
@ -125,6 +128,8 @@ class Job
* Update the status of the current job.
*
* @param int $status Status constant from \Resque\Job\Status indicating the current status of a job.
*
* @return bool
*/
public function updateStatus($status): bool
{
@ -164,6 +169,7 @@ class Job
/**
* Get the instantiated object for this job that will be performing work.
*
* @return \Resque\Job\JobInterface Instance of the object that this job belongs to.
*/
public function getInstance()
@ -182,6 +188,7 @@ class Job
* associated with the job with the supplied arguments.
*
* @return bool
*
* @throws \Resque\Exception When the job's class could not be found or it does not contain a perform method.
*/
public function perform()
@ -234,6 +241,7 @@ class Job
/**
* Re-queue the current job.
*
* @return string
*/
public function recreate()
@ -269,6 +277,7 @@ class Job
/**
* @param FactoryInterface $jobFactory
*
* @return Job
*/
public function setJobFactory(FactoryInterface $jobFactory)

View file

@ -59,7 +59,7 @@ class Status
'updated' => time(),
'started' => time(),
];
\Resque\Resque::redis()->set('job:' . $id . ':status', json_encode($statusPacket));
\Resque\Resque::redis()->setex('job:' . $id . ':status', 172800, json_encode($statusPacket));
}
/**
@ -98,7 +98,7 @@ class Status
'status' => $status,
'updated' => time(),
];
\Resque\Resque::redis()->set((string)$this, json_encode($statusPacket));
\Resque\Resque::redis()->setex((string)$this, 172800, json_encode($statusPacket));
// Expire the status for completed jobs after 24 hours
if (in_array($status, self::$completeStatuses)) {

View file

@ -163,6 +163,7 @@ class Redis
* Note: the 'user' part of the DSN is not used.
*
* @param string $dsn A DSN string
*
* @return array An array of DSN compotnents, with 'false' values for any unknown components. e.g.
* [host, port, db, user, pass, options]
*/

View file

@ -12,5 +12,4 @@ namespace Resque;
class RedisException extends \Exception
{
}

View file

@ -149,6 +149,7 @@ class Worker
*
* @param int $interval How often to check for new jobs across the queues.
* @param bool $blocking
*
* @throws Resque_RedisException
*/
public function work($interval = Resque::DEFAULT_INTERVAL, $blocking = false)
@ -524,7 +525,7 @@ class Worker
'run_at' => strftime('%a %b %d %H:%M:%S %Z %Y'),
'payload' => $job->payload
]);
Resque::redis()->set('worker:' . $job->worker, $data);
Resque::redis()->setex('worker:' . $job->worker, 172800, $data);
}
/**