[zh] Fix typo in worker.py example script
This commit is contained in:
@@ -8,11 +8,11 @@ host="redis"
|
|||||||
# import os
|
# import os
|
||||||
# host = os.getenv("REDIS_SERVICE_HOST")
|
# host = os.getenv("REDIS_SERVICE_HOST")
|
||||||
|
|
||||||
q = rediswq.RedisWQ(name="job2", host="redis")
|
q = rediswq.RedisWQ(name="job2", host=host)
|
||||||
print("Worker with sessionID: " + q.sessionID())
|
print("Worker with sessionID: " + q.sessionID())
|
||||||
print("Initial queue state: empty=" + str(q.empty()))
|
print("Initial queue state: empty=" + str(q.empty()))
|
||||||
while not q.empty():
|
while not q.empty():
|
||||||
item = q.lease(lease_secs=10, block=True, timeout=2)
|
item = q.lease(lease_secs=10, block=True, timeout=2)
|
||||||
if item is not None:
|
if item is not None:
|
||||||
itemstr = item.decode("utf-8")
|
itemstr = item.decode("utf-8")
|
||||||
print("Working on " + itemstr)
|
print("Working on " + itemstr)
|
||||||
|
|||||||
Reference in New Issue
Block a user