Skip to content

Commit f15c5ac

Browse files
committed
优化,消息处理成功时,从超时队列中删除
1 parent 565ae95 commit f15c5ac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Driver/RedisQueueDriver.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,15 +297,18 @@ public function success(IMessage $message)
297297
$result = $redis->evalEx(<<<LUA
298298
-- 从工作队列删除
299299
redis.call('zrem', KEYS[1], ARGV[1])
300+
-- 从超时队列删除
301+
redis.call('del', KEYS[3])
300302
-- 删除消息
301303
redis.call('del', KEYS[2] .. ARGV[1])
302304
return true
303305
LUA
304306
, [
305307
$this->getQueueKey(QueueType::WORKING),
306308
$this->getMessageKeyPrefix(),
309+
$this->getQueueKey(QueueType::TIMEOUT),
307310
$message->getMessageId(),
308-
], 2);
311+
], 3);
309312

310313
if(false === $result)
311314
{

0 commit comments

Comments
 (0)