Skip to content
This repository has been archived by the owner on Jan 10, 2019. It is now read-only.

job created despite error from redis #14

Open
mwhooker opened this issue Apr 5, 2012 · 0 comments
Open

job created despite error from redis #14

mwhooker opened this issue Apr 5, 2012 · 0 comments

Comments

@mwhooker
Copy link

mwhooker commented Apr 5, 2012

If redis throws an error (presumably any error, but a TypeError in my case), the job is still added to the queue. I'm not sure if this if expected behavior, but to me it looks like the job queue is in an inconsistent state. I would have thought the job would not be added to the queue.

>>> job = Thoonk().job('test')
>>> job.get_ids()
[]
>>> job.put(None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
>>> File "/Users/mwhooker/dev/a-posteriori/thoonk/venv/lib/python2.7/site-packages/thoonk/feeds/job.py", line 160, in put
self.thoonk._publish(self.feed_publishes, (id, item))
File "/Users/mwhooker/dev/a-posteriori/thoonk/venv/lib/python2.7/site-packages/thoonk/pubsub.py", line 121, in _publish
self.redis.publish(schema, "x00".join(items))
TypeError: sequence item 1: expected string, NoneType found

>>> job.get_ids()
['28feed9dc90640a7a355763579b4f540']
>>> job.get()
('28feed9dc90640a7a355763579b4f540', 'None', 0)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant