python-rq worker not reading jobs in queue

ete*_*ker 4 python python-rq

I'm facing a basic issue while setting up python-rq - the rqworker doesn't seem to recognize jobs that are pushed to the queue it's listening on.

Everything is run inside virtualenv
I have the following code:

from redis import Redis
from rq import Queue
from rq.registry import FinishedJobRegistry
from videogen import videogen
import time

redis_conn = Redis(port=5001)
videoq = Queue('medium', connection=redis_conn)
fin_registry = FinishedJobRegistry(connection=redis_conn, name='medium')

jobid = 1024
job = videoq.enqueue(videogen, jobid)

while not job.is_finished:
    time.sleep(2)
    print job.result
Run Code Online (Sandbox Code Playgroud)

Here videogen is a simple function which immediately returns the integer parameter it receives.

On running rqworker medium and starting the app, there is no result printed. There are NO extra traces at rqworker other than this:

14:41:29 RQ worker started, version 0.5.0
14:41:29 
14:41:29 *** Listening on medium...
Run Code Online (Sandbox Code Playgroud)

The redis instance is accessible from the same shell where I run rqworker, as even shows the updated keys:

127.0.0.1:5001> keys *
1) "rq:queues"
2) "rq:queue:medium"
3) "rq:job:9a46f9c5-03e1-4b08-946b-61ad2c3815b1"
Run Code Online (Sandbox Code Playgroud)

So what is possibly missing here?

ete*_*ker 8

愚蠢的错误 - 必须向 rqworker 提供 redis 连接 url
rqworker --url redis://localhost:5001 medium