I'm pretty new to Redis queuing job task. I tried to do some function on the queue by using Redis To Go Add-on. But after I push some task on queue it seems to disappear.
Here is my code
import Flask
import redis
from rq import Queue
REDIS_URL = os.getenv('REDISTOGO_URL', None)
if REDIS_URL!=None:
r = redis.from_url(REDIS_URL)
else:
r = redis.Redis()
q = Queue(connection=r)
def function(pam1):
print("Checkpoint1")
return 0
@main.route('/name', methods=['GET', 'POST'])
def displayname():
job = q.enqueue(function, pam1=0)
return job.id
Additional info on queue: There still give the job id eg.7344337b-cca0-442a-b43a-abcdc88f012c.
but no sign of "Checkpoint1" on heroku log at all.
Thanks to @v25. The real reason that Redis not responds because I don't have a WORKER. After get thu see the Heroku guide on launching a worker now my problem solved.