From a5a763de98129f136aa9c9f327265aaf465078d0 Mon Sep 17 00:00:00 2001 From: vapao Date: Fri, 20 Mar 2020 16:35:45 +0800 Subject: [PATCH] =?UTF-8?q?F=20=E4=BF=AE=E5=A4=8D=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=8F=AF=E8=83=BD=E6=84=8F=E5=A4=96=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_api/consumer/consumers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spug_api/consumer/consumers.py b/spug_api/consumer/consumers.py index 01c69c54..cd0f12a6 100644 --- a/spug_api/consumer/consumers.py +++ b/spug_api/consumer/consumers.py @@ -32,7 +32,8 @@ def get_response(self): if self.log_key: return self.rds.brpoplpush(self.token, self.log_key, timeout=5) else: - return self.rds.brpop(self.token, timeout=5)[1] + response = self.rds.brpop(self.token, timeout=5) + return response[1] if response else None def receive(self, **kwargs): response = self.get_response()