mirror of
https://github.com/idanoo/php-resque.git
synced 2024-11-21 16:01:53 +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
@ -1,3 +1,6 @@
|
||||
# 2.1.3 (2023-11-15)
|
||||
- Resolved issue with SET EX TTL's using unix-timestamps
|
||||
|
||||
# 2.1.2 (2023-03-22)
|
||||
- Update composer packages
|
||||
- Update git information (GitHub)
|
||||
|
16
README.md
16
README.md
@ -1,4 +1,4 @@
|
||||
php-resque: PHP Resque Worker (and Enqueue)
|
||||
php-resque: PHP Background (Resque) Worker
|
||||
===========================================
|
||||
|
||||
Resque is a Redis-backed library for creating background jobs, placing
|
||||
@ -53,19 +53,9 @@ Composer package inside your project.
|
||||
|
||||
If you're not familiar with Composer, please see <http://getcomposer.org/>.
|
||||
|
||||
1. Add php-resque to your application's composer.json.
|
||||
1. Run `composer require idanoo/php-resque`.
|
||||
|
||||
```json
|
||||
{
|
||||
"require": {
|
||||
"idanoo/php-resque": "^2.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
2. Run `composer install`.
|
||||
|
||||
3. If you haven't already, add the Composer autoload to your project's
|
||||
2. If you haven't already, add the Composer autoload to your project's
|
||||
initialization file. (example)
|
||||
|
||||
```sh
|
||||
|
@ -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)],
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ class RedisTest extends TestCase
|
||||
$this->redis->set(
|
||||
'testKey',
|
||||
24,
|
||||
['ex' => time() + 3600],
|
||||
['ex' => 3600],
|
||||
);
|
||||
|
||||
$val = $this->redis->get("testKey");
|
||||
|
Loading…
Reference in New Issue
Block a user