Skip to content

Commit 6159d3c

Browse files
committed
Optimization
1 parent 134cb38 commit 6159d3c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Driver/Redis.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ class Redis implements DriverInterface
1616
*/
1717
public function __construct(?Worker $worker, protected string $connection)
1818
{
19-
Timer::add(24 * 60 * 60, function () {
20-
$this->clearExpire();
21-
});
19+
if ($worker) {
20+
Timer::add(24 * 60 * 60, function () {
21+
$this->clearExpire();
22+
});
23+
}
2224
$this->clearExpire();
2325
}
2426

0 commit comments

Comments
 (0)