109 Commits (2af3d829b09c6243148a561b0495965c95a27db0)

Author SHA1 Message Date
Selwin Ong 7021cedaf9
Implemented Job.fetch_many (#1072) 6 years ago
Selwin Ong c4cbb3af2f
RQ v1.0! (#1059)
* Added FailedJobRegistry.

* Added job.failure_ttl.

* queue.enqueue() now supports failure_ttl

* Added registry.get_queue().

* FailedJobRegistry.add() now assigns DEFAULT_FAILURE_TTL.

* StartedJobRegistry.cleanup() now moves expired jobs to FailedJobRegistry.

* Failed jobs are now added to FailedJobRegistry.

* Added FailedJobRegistry.requeue()

* Document the new `FailedJobRegistry` and changes in custom exception handler behavior.

* Added worker.disable_default_exception_handler.

* Document --disable-default-exception-handler option.

* Deleted worker.failed_queue.

* Deleted "move_to_failed_queue" exception handler.

* StartedJobRegistry should no longer move jobs to FailedQueue.

* Deleted requeue_job

* Fixed test error.

* Make requeue cli command work with FailedJobRegistry

* Added .pytest_cache to gitignore.

* Custom exception handlers are no longer run in reverse

* Restored requeue_job function

* Removed get_failed_queue

* Deleted FailedQueue

* Updated changelog.

* Document `failure_ttl`

* Updated docs.

* Remove job.status

* Fixed typo in test_registry.py

* Replaced _pipeline() with pipeline()

* FailedJobRegistry no longer fails on redis-py>=3

* Fixes test_clean_registries

* Worker names are now randomized

* Added a note about random worker names in CHANGES.md

* Worker will now stop working when encountering an unhandled exception.

* Worker should reraise SystemExit on cold shutdowns

* Added anchor.js to docs

* Support for Sentry-SDK (#1045)

* Updated RQ to support sentry-sdk

* Document Sentry integration

* Install sentry-sdk before running tests

* Improved rq info CLI command to be more efficient when displaying lar… (#1046)

* Improved rq info CLI command to be more efficient when displaying large number of workers

* Fixed an rq info --by-queue bug

* Fixed worker.total_working_time bug (#1047)

* queue.enqueue() no longer accepts `timeout` argument (#1055)

* Clean worker registry (#1056)

* queue.enqueue() no longer accepts `timeout` argument

* Added clean_worker_registry()

* Show worker hostname and PID on cli (#1058)

* Show worker hostname and PID on cli

* Improve test coverage

* Remove Redis version check when SSL is used

* Bump version to 1.0

* Removed pytest_cache/README.md

* Changed worker logging to use exc_info=True

* Removed unused queue.dequeue()

* Fixed typo in CHANGES.md

* setup_loghandlers() should always call logger.setLevel() if specified
6 years ago
chevell c2b939d2df Replace 'async' keyword with 'is_async' for Queue objects (#977)
* 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
7 years ago
Theofanis Despoudis 875cc27c2f #908 Using a timeout string value for job works (#955)
Fixes https://github.com/rq/rq/issues/908
7 years ago
stj 487ef72f21 Define redis key prefix as class variable (#939)
* 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
7 years ago
Christophe Olinger a6eb5d37ee Delete dependents of job explicitely (#916)
* 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
7 years ago
Selwin Ong f500186f3d
Job compression (#907)
job.exc_info and job.data is now stored in compressed format in Redis.

* job.data is now stored in compressed format.
7 years ago
Samuel Colvin 260fd84f51 add milliseconds into timestamps, fix #721 7 years ago
Theo 096c5ad3c2 Fixed #866 - Flak8 errors 7 years ago
Selwin Ong 0efb87a46b Fixed test error in Python 3. 8 years ago
Selwin Ong 54bc04bb45 job.save() shouldn't crash on unpickleable return value. 8 years ago
Alexey Katichev 3596449cc0 remove implicit cleanup call from job.save 8 years ago
Alexey Katichev a0113c83cf introduce job.update_meta() to store updated meta to Redis (#823)
* introduce job.update_meta() to store updated meta to Redis

This closes nvie/rq#811

* rename update_meta to save_meta
8 years ago
Felipe Lacerda cab89254b5 Make `Queue.enqueue_job()` execute immediately if `async=False` (#798)
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.
8 years ago
Selwin Ong f760fcb20f job.delete() should cleans itself from FailedQueue and various registries. 8 years ago
Jannis Leidel c019662430
Allow passing backend classes (job, queue, worker, connection) from CLI and other APIs
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
8 years ago
Arnold Krille df22f127eb Test the worker in its own subprocess
- 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)
9 years ago
Javier Lopez e92b57d128 test_job.py: Add cancel test on failed queue 9 years ago
Javier Lopez 091c2568c9 test_job.py: Add test for cancel_job function 9 years ago
Eduard Carreras 89facfada6 Test to ensure job is finished in not async mode 9 years ago
Selwin Ong 5afd1a90e5 Merge pull request #589 from samuelcolvin/job-started_at
add job.started_at
9 years ago
Selwin Ong 8bbd833855 Merge pull request #600 from glaslos/cancel_remove
Cancel and Delete differences
9 years ago
ahxxm b06f112cb0 fix tests
syntax: assertEquals -> assertEqual, assertNotEquals -> assertNotEqual
usage: status of worker and job now will use get/set method instead of property method
9 years ago
glaslos 0a6df13d9d delete dependents and delete in cleanup. Fixed tests. 9 years ago
Samuel Colvin 082e61a212 add job.started_at 9 years ago
Selwin Ong 0e4112da7a Modified patch_connection to allow Redis connection to be easily mocked. 9 years ago
Vincent Driessen 3b67894489 Rename variable in test 10 years ago
Marcus Martins ab6c129833 Fix broken tests 10 years ago
Marcus Martins 5b8726ad2d Fixes #502
Fixes some broken tests and misbehaviour with ttls. There was a temporal
coupling between saving the job and setting its expires parameter.
10 years ago
Robert Brownstein 303f4ed47c Added test coverage for unicode keyword argument support in method signatures (#536) 10 years ago
Vincent Driessen f651a72a50 Make clearer what are fixture functions 10 years ago
Vincent Driessen df4d4c8d5d Make test cases more explicit 10 years ago
Selwin Ong cff6fbff41 Merge pull request #477 from glaslos/ttl_tests_fixes
TTL tests and fixes
10 years ago
glaslos 071c47dacb hard-coded TTL to -1 on job.perform()
Removed merge artifacts
10 years ago
Serhii Maltsev 91f263d8e0 change try/except in python2/3 compatibility to to_text() 10 years ago
glaslos 3d4d6a86d5 persist the job right before execution 10 years ago
glaslos 24d5e08992 Merge branch 'master' into ttl_tests_fixes
Conflicts:
	tests/test_job.py
10 years ago
alternativshik 219f21b637 Allow non-ASCII characters in arguments
get_call_string() failed if any arguments contained non-ASCII strings.

Fixes #406
10 years ago
Vincent Driessen b8d425b318 Various PEP8 fixes. 10 years ago
Vincent Driessen fac2b10309 Auto-sort imports using isort. 10 years ago
glaslos 646f1cda22 Merge branch 'master' into ttl_tests_fixes
Conflicts:
	rq/queue.py
10 years ago
glaslos 3af0e95ce5 adding two tests to ensure ttl behaviour 10 years ago
Selwin Ong dac0be6cc7 Added DeferredJobsRegistry to keep track of deferred jobs. 10 years ago
glaslos 8a3fd91e2e renaming job.job_ttl to job.ttl 10 years ago
glaslos 55c541bc59 added job ttl to queue.enqueue() 10 years ago
zhangliyong f9511664c8 Make flake8 happy :) 10 years ago
Cal Leeming 6aa2e18f88 Another unused import, oops 10 years ago
foxx 72bc9e37b7 Forced job_id to only allow str/unicode 10 years ago
foxx 05c1d4fa4b Added better job ID tests 10 years ago
foxx 6bb8b26114 Allow job ID to be set on enqueue/enqueue_call() - fixes #412 10 years ago