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

job created despite error from redis #14

@mwhooker

Description

@mwhooker

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions