diff --git a/src/Resque/Stat.php b/src/Resque/Stat.php index 76bd069..45bfe45 100644 --- a/src/Resque/Stat.php +++ b/src/Resque/Stat.php @@ -71,6 +71,6 @@ class Stat */ public static function clear(string $stat): bool { - return (bool)Resque::redis()->unlink('stat:' . $stat); + return (bool)Resque::redis()->del('stat:' . $stat); } } diff --git a/tests/Resque/Tests/WorkerTest.php b/tests/Resque/Tests/WorkerTest.php index a8d0a69..e1b22e4 100644 --- a/tests/Resque/Tests/WorkerTest.php +++ b/tests/Resque/Tests/WorkerTest.php @@ -198,6 +198,9 @@ class WorkerTest extends TestCase $worker->work(0); $worker->work(0); + // Allow time for async unlink to work + sleep(2); + $this->assertEquals(0, $worker->getStat('processed')); $this->assertEquals(0, $worker->getStat('failed')); }