File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,8 @@ public function consume(int $timeout = 0): void
36
36
throw new \LogicException ('No subscribers ' );
37
37
}
38
38
39
- $ timeout /= 1000 ;
40
- $ endAt = microtime ( true ) + $ timeout ;
39
+ $ timeout = ( int ) ceil ( $ timeout / 1000 ) ;
40
+ $ endAt = time ( ) + $ timeout ;
41
41
42
42
$ queueNames = [];
43
43
foreach (array_keys ($ this ->subscribers ) as $ queueName ) {
@@ -55,7 +55,7 @@ public function consume(int $timeout = 0): void
55
55
* @var PsrConsumer $consumer
56
56
* @var callable $processor
57
57
*/
58
- $ result = $ this ->context ->getRedis ()->brpop ($ currentQueueNames , $ timeout ?: 5000 );
58
+ $ result = $ this ->context ->getRedis ()->brpop ($ currentQueueNames , $ timeout ?: 5 );
59
59
if ($ result ) {
60
60
$ message = RedisMessage::jsonUnserialize ($ result ->getMessage ());
61
61
list ($ consumer , $ callback ) = $ this ->subscribers [$ result ->getKey ()];
You can’t perform that action at this time.
0 commit comments