ryanhiebert / hirefire

A Python lib to integrate with the HireFire service -- The Heroku Proccess Manager.
https://hirefire.readthedocs.io/
Other
34 stars 21 forks source link

Missing parentheses for queue_names method in rq/procs.py #5

Closed miken closed 9 years ago

miken commented 10 years ago

Hi,

I'm using django-rq with hirefire and ran into a 500 server error after having my background tasks run. It's a TypeError saying "argument of type 'instancemethod' is not iterable." Upon investigating further, I think the issue is with procs/rq.py: there are missing parentheses for the method queue_names.

Currently it looks like this in rq.py:

                try:
                    if (queue.name in worker.queue_names and
                            worker.get_current_job() is not None):
                        count += 1
                except NoSuchJobError:
                    # the jobs have vanished for some reason from Redis
                    # weren't able to be fetched from the worker
                    continue

After adding () to queue_names as follows, I don't run into that same error anymore.

                try:
                    if (queue.name in worker.queue_names() and
                            worker.get_current_job() is not None):
                        count += 1
                except NoSuchJobError:
                    # the jobs have vanished for some reason from Redis
                    # weren't able to be fetched from the worker
                    continue

Let me know if I can provide more context to help with. Thanks!

ryanisnan commented 9 years ago

I'm also experiencing this issue. From looking at https://github.com/nvie/rq/blob/master/rq/worker.py#L381, it appears that you are right @miken.

I will submit a PR if you have not.

miken commented 9 years ago

@ryanisnan Please go ahead and create a PR. Thanks for looking into it!

ryanisnan commented 9 years ago

This issue should be resolved in PR #6

jezdez commented 9 years ago

Yikes! Closed now :) Bugfix release coming..

jezdez commented 9 years ago

Done, 0.2.2 is on PyPI.

ryanisnan commented 9 years ago

Thanks Jannis! @jezdez