mirror of
https://github.com/idanoo/php-resque
synced 2025-07-01 21:52:21 +00:00
2.1.3 (2023-11-15)
- Resolved issue with SET EX TTL's using unix-timestamps
This commit is contained in:
parent
0b925b68bd
commit
948b758a57
6 changed files with 16 additions and 21 deletions
|
@ -62,7 +62,7 @@ class Status
|
|||
\Resque\Resque::redis()->set(
|
||||
'job:' . $id . ':status',
|
||||
json_encode($statusPacket),
|
||||
['ex' => time() + 86400],
|
||||
['ex' => (86400 * 2)],
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ class Status
|
|||
\Resque\Resque::redis()->set(
|
||||
(string)$this,
|
||||
json_encode($statusPacket),
|
||||
['ex' => time() + 86400],
|
||||
['ex' => (86400 * 2)],
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class Stat
|
|||
$set = Resque::redis()->set(
|
||||
'stat:' . $stat,
|
||||
$by,
|
||||
['ex' => time() + 86400, 'nx'],
|
||||
['ex' => (86400 * 2), 'nx'],
|
||||
);
|
||||
|
||||
// If it already exists, return the incrby value
|
||||
|
|
|
@ -486,15 +486,17 @@ class Worker
|
|||
|
||||
/**
|
||||
* Register this worker in Redis.
|
||||
* 48 hour TTL so we don't pollute the db on server termination.
|
||||
* 48 hour TTL so we don't pollute the redis db on server termination.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function registerWorker()
|
||||
public function registerWorker(): void
|
||||
{
|
||||
Resque::redis()->sadd('workers', (string)$this);
|
||||
Resque::redis()->set(
|
||||
'worker:' . (string)$this . ':started',
|
||||
date('D M d H:i:s T Y'),
|
||||
['ex' => time() + 86400],
|
||||
['ex' => (86400 * 2)],
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -535,7 +537,7 @@ class Worker
|
|||
Resque::redis()->set(
|
||||
'worker:' . $job->worker,
|
||||
$data,
|
||||
['ex' => time() + 86400],
|
||||
['ex' => (86400 * 2)],
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue