Skip to content

Commit 948b758

Browse files
committed
2.1.3 (2023-11-15)
- Resolved issue with SET EX TTL's using unix-timestamps
1 parent 0b925b6 commit 948b758

File tree

6 files changed

+16
-21
lines changed

6 files changed

+16
-21
lines changed

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 2.1.3 (2023-11-15)
2+
- Resolved issue with SET EX TTL's using unix-timestamps
3+
14
# 2.1.2 (2023-03-22)
25
- Update composer packages
36
- Update git information (GitHub)

Diff for: README.md

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
php-resque: PHP Resque Worker (and Enqueue)
1+
php-resque: PHP Background (Resque) Worker
22
===========================================
33

44
Resque is a Redis-backed library for creating background jobs, placing
@@ -53,19 +53,9 @@ Composer package inside your project.
5353

5454
If you're not familiar with Composer, please see <http://getcomposer.org/>.
5555

56-
1. Add php-resque to your application's composer.json.
56+
1. Run `composer require idanoo/php-resque`.
5757

58-
```json
59-
{
60-
"require": {
61-
"idanoo/php-resque": "^2.0"
62-
}
63-
}
64-
```
65-
66-
2. Run `composer install`.
67-
68-
3. If you haven't already, add the Composer autoload to your project's
58+
2. If you haven't already, add the Composer autoload to your project's
6959
initialization file. (example)
7060

7161
```sh

Diff for: src/Resque/Job/Status.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static function create($id)
6262
\Resque\Resque::redis()->set(
6363
'job:' . $id . ':status',
6464
json_encode($statusPacket),
65-
['ex' => time() + 86400],
65+
['ex' => (86400 * 2)],
6666
);
6767
}
6868

@@ -106,7 +106,7 @@ public function update($status)
106106
\Resque\Resque::redis()->set(
107107
(string)$this,
108108
json_encode($statusPacket),
109-
['ex' => time() + 86400],
109+
['ex' => (86400 * 2)],
110110
);
111111
}
112112

Diff for: src/Resque/Stat.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static function incr(string $stat, int $by = 1): bool
3838
$set = Resque::redis()->set(
3939
'stat:' . $stat,
4040
$by,
41-
['ex' => time() + 86400, 'nx'],
41+
['ex' => (86400 * 2), 'nx'],
4242
);
4343

4444
// If it already exists, return the incrby value

Diff for: src/Resque/Worker.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -486,15 +486,17 @@ public function workerPids()
486486

487487
/**
488488
* Register this worker in Redis.
489-
* 48 hour TTL so we don't pollute the db on server termination.
489+
* 48 hour TTL so we don't pollute the redis db on server termination.
490+
*
491+
* @return void
490492
*/
491-
public function registerWorker()
493+
public function registerWorker(): void
492494
{
493495
Resque::redis()->sadd('workers', (string)$this);
494496
Resque::redis()->set(
495497
'worker:' . (string)$this . ':started',
496498
date('D M d H:i:s T Y'),
497-
['ex' => time() + 86400],
499+
['ex' => (86400 * 2)],
498500
);
499501
}
500502

@@ -535,7 +537,7 @@ public function workingOn(\Resque\Job\Job $job)
535537
Resque::redis()->set(
536538
'worker:' . $job->worker,
537539
$data,
538-
['ex' => time() + 86400],
540+
['ex' => (86400 * 2)],
539541
);
540542
}
541543

Diff for: tests/Resque/Tests/RedisTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function testRedisGetSet()
1717
$this->redis->set(
1818
'testKey',
1919
24,
20-
['ex' => time() + 3600],
20+
['ex' => 3600],
2121
);
2222

2323
$val = $this->redis->get("testKey");

0 commit comments

Comments
 (0)