Commit Graph

98 Commits (5f5e1137901dea27e6e567d8a29f31ffa84d8765)

Author SHA1 Message Date
Alexey Katichev 3596449cc0 remove implicit cleanup call from job.save
Alexey Katichev a0113c83cf introduce job.update_meta() to store updated meta to Redis ()
* introduce job.update_meta() to store updated meta to Redis

This closes 

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

Fixes 
Vincent Driessen b8d425b318 Various PEP8 fixes.
Vincent Driessen fac2b10309 Auto-sort imports using isort.
glaslos 646f1cda22 Merge branch 'master' into ttl_tests_fixes
Conflicts:
	rq/queue.py
glaslos 3af0e95ce5 adding two tests to ensure ttl behaviour
Selwin Ong dac0be6cc7 Added DeferredJobsRegistry to keep track of deferred jobs.
glaslos 8a3fd91e2e renaming job.job_ttl to job.ttl
glaslos 55c541bc59 added job ttl to queue.enqueue()
zhangliyong f9511664c8 Make flake8 happy :)
Cal Leeming 6aa2e18f88 Another unused import, oops
foxx 72bc9e37b7 Forced job_id to only allow str/unicode
foxx 05c1d4fa4b Added better job ID tests
foxx 6bb8b26114 Allow job ID to be set on enqueue/enqueue_call() - fixes
Vincent Driessen 3ded050804 Replace by a string just as wide to not make this invalid binary pickle data.
Vincent Driessen 79db282879 Support enqueueing callable classes.
Fixes .
Selwin Ong 638211df20 job.cancel() should remove itself from queue.
Vincent Driessen 38ec259b6e Enable the most modern Python syntax.
Vincent Driessen a2213f1364 Fix tests.
Vincent Driessen 44233709ed Allow two-way setting of job data properties.
As a side-effect, this also enables us to lazily load the data.
Malthe Borch ba0b39a43b Unpickle job data lazily. This fixes issue .
Malthe Borch c5a381fbe9 Remove dependency on 'times' library (see issue ).
Basically, for the functionality needed, a dependency on 'times' (which
in turn depends on 'python-dateutil') seem unnecessary.
Selwin Ong b997fb45bf Removed unnecessary lines from test_job.py.
Selwin Ong 8aa5771646 job.cancel() now deletes dependents_key
Vincent Driessen bb3dc5b0b2 Terminology change: waitlist -> dependents.