1
This commit is contained in:
1 parent
a555102862
commit
1900f1acd5
1 file changed
+2
-2
@@ -99,12 +99,12 @@ def main():
|
||||
while True:
|
||||
r = redisClient()
|
||||
#检测队列是否有值
|
||||
if r.llen('pb:sliceing') == 0:
|
||||
if r.scard('pb:sliceing') == 0:
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} 队列为空,等待10秒')
|
||||
time.sleep(10)
|
||||
continue
|
||||
#获取队列中的值
|
||||
data = r.lpop('pb:sliceing')
|
||||
data = r.spop('pb:sliceing')
|
||||
if data is None:
|
||||
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} 取出的数据为空,等待10秒')
|
||||
time.sleep(10)
|
||||
|
||||
Reference in new issue
Block a user