mirror of
https://github.com/idanoo/php-resque
synced 2025-07-01 21:52:21 +00:00
Added 48 hour TTL to worker:xxx:started keys to prevent db pollution
This commit is contained in:
parent
b235fce1bd
commit
493d6dc6d8
17 changed files with 158 additions and 141 deletions
|
@ -29,10 +29,10 @@ class Resque_Job_Status
|
|||
/**
|
||||
* @var array Array of statuses that are considered final/complete.
|
||||
*/
|
||||
private static $completeStatuses = array(
|
||||
private static $completeStatuses = [
|
||||
self::STATUS_FAILED,
|
||||
self::STATUS_COMPLETE
|
||||
);
|
||||
];
|
||||
|
||||
/**
|
||||
* Setup a new instance of the job monitor class for the supplied job ID.
|
||||
|
@ -52,11 +52,11 @@ class Resque_Job_Status
|
|||
*/
|
||||
public static function create($id)
|
||||
{
|
||||
$statusPacket = array(
|
||||
$statusPacket = [
|
||||
'status' => self::STATUS_WAITING,
|
||||
'updated' => time(),
|
||||
'started' => time(),
|
||||
);
|
||||
];
|
||||
Resque::redis()->set('job:' . $id . ':status', json_encode($statusPacket));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue