diff --git a/src/agentscope/server/async_result_pool.py b/src/agentscope/server/async_result_pool.py index 631afaac7..5ff0f37a4 100644 --- a/src/agentscope/server/async_result_pool.py +++ b/src/agentscope/server/async_result_pool.py @@ -118,8 +118,10 @@ def prepare(self) -> int: return self._get_object_id() def set(self, key: int, value: bytes) -> None: - self.pool.set(key, value, ex=self.max_timeout) - self.pool.rpush(RedisPool.TASK_QUEUE_PREFIX + str(key), key) + pipe = self.pool.pipeline() + pipe.set(key, value, ex=self.max_timeout) + pipe.rpush(RedisPool.TASK_QUEUE_PREFIX + str(key), key) + pipe.execute() def get(self, key: int) -> bytes: result = self.pool.get(key)