Skip to content

Commit

Permalink
F 修复执行发布可能意外报错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
vapao committed Mar 20, 2020
1 parent 6585610 commit a5a763d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spug_api/consumer/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit a5a763d

Please sign in to comment.