* modify zadd calls for redis-py 3.0
redis-py 3.0 changes the zadd interface that accepts a single
mapping argument that is expected to be a dict.
https://github.com/andymccurdy/redis-py#mset-msetnx-and-zadd
* change FailedQueue.push_job_id to always push a str
redis-py 3.0 does not attempt to cast values to str and is left
to the user.
* remove Redis connection patching
Since in redis-py 3.0, Redis == StrictRedis class, we no longer
need to patch _zadd and other methods.
Ref: https://github.com/rq/rq/pull/1016#issuecomment-441010847
* Replaced async keyword with is_async in the Queue class to fix reserved keyword syntax errors in Python 3.7
* Updated tests to use is_async keyword when instantiating Queue objects
* Updated docs to reference is_async keyword for Queue objects
* Updated tox.ini, setup.py and .travis.yml with references to Python 3.7
* Define redis key prefix as class variable
Some prefixes were hardcoded in several places. This made it hard to
use custom prefixes via subclasses.
Resolves#920
* fixup! Define redis key prefix as class variable
* Initial take on delete_dependents
* Add tests including corner cases
* No need to canel dependents since they are not in a queue yet anyway
* The dependents keys can be deleted in all cases
* Update tests to included saved jobs in the deletion tests
* Correctly use pipeline in cancel method
* Unused connection
* Include dependents into dict format of job
* Add TODO
* Address comments from selwin
* Delete dependents key in redis if delete_dependents is called on its own
* Address recent comments from selwin
* Small change to trigger travis
* Remove TODO referring to canceled job state
* Remove dependent_ids from to_dict
* Address recent comments from selwin
* job.exc_info is now compressed.
* job.data is now stored in compressed format.
* Added worker_registration.unregister.
* Added worker_registration.get_keys().
* Modified Worker.all(), Worker.all_keys() and Worker.count() to accept "connection" and "queue" arguments.
* Fixed an issue where `birth` not present in Redis
Fixed an issue where worker.refresh() may fail if `birth` is not present in Redis
* added test coverage
* First stab at implementing worker statistics.
* Moved worker data restoration logic to worker.refresh().
* Failed and successfull job counts are now properly incremented.
* Worker now keeps track of total_working_time
* Ensure job.ended_at is set in the case of unhandled job failure.
* handle_job_failure shouldn't crash if job.started_at is not present.
* Added a custom exception for timeout transfer
* Added a util to transfer timeout to a united format
* Transfer timeout format when creating a queue or enqueue jobs
* Fixed typos
* Fixed bug in transfer_timeout function
* Added test for function transfer_timeout
* Updated transfer_timeout to allow uppercase unit
* Renamed function in utils
* Solve the UnicodeDecodeError while decode literal things.
* Add test case for when worker result is a unicode or str object that other than
pure ascii content.
Currently, the job is being performed inside `enqueue_call()`, which
means that `async=False` has no effect if `enqueue_job()` is called
directly. This commit fixes that.
Worker handle_exception and move_to_failed_queue couldn't handle a situation where the exception raised had non-ascii characters. This caused a UnicodeDecodeError when trying to format the exception strings.
If on Python 2, ensure strings get decoded before building the exception string.
Closes#482
This includes:
- a partial refactor of the CLI to organize the shared options
- extends the tests in areas where passing custom backend classes makes sense
- allow setting the core CLI options as env vars
- minor cosmetic changes here and there
Test that demonstrates that if a work-horse process is terminated unexpectedly
the job being processed could be stuck at the "Started" state
(https://github.com/nvie/rq/issues/702)
- run with an empty queue
- schedule one job (which uses get_current_connection and get_current_job) and
run `rqworker`
- schedule a job that itself schedules `access_self` and run `rqworker`
- Make sure the job didn't fail by assuring the failed queue is still empty
afterwards.
- Install this package locally when running in travis.
This actually unifies the behaviour of tox and travis as tox also builds the
package and then installs it into each test environment.
- fix flake8 (as run by tox)
This make it easy to write Python 2/3 compatible code.
e.g.
Worker(sys.argv[1:])
# Without from __future__ import unicode_literals
Worker(['high', 'normal', 'low'])
syntax: assertEquals -> assertEqual, assertNotEquals -> assertNotEqual
usage: status of worker and job now will use get/set method instead of property method