145 Commits (bd0731025377d5e8ebcbce78026698a57dea01df)

Author SHA1 Message Date
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
Vincent Driessen 3ded050804 Replace by a string just as wide to not make this invalid binary pickle data. 11 years ago
Vincent Driessen 79db282879 Support enqueueing callable classes.
Fixes #388.
11 years ago
Selwin Ong 638211df20 job.cancel() should remove itself from queue. 11 years ago
Vincent Driessen 38ec259b6e Enable the most modern Python syntax. 11 years ago
Vincent Driessen a2213f1364 Fix tests. 11 years ago
Vincent Driessen 44233709ed Allow two-way setting of job data properties.
As a side-effect, this also enables us to lazily load the data.
11 years ago
Malthe Borch ba0b39a43b Unpickle job data lazily. This fixes issue #294. 11 years ago
Malthe Borch c5a381fbe9 Remove dependency on 'times' library (see issue #286).
Basically, for the functionality needed, a dependency on 'times' (which
in turn depends on 'python-dateutil') seem unnecessary.
11 years ago
Selwin Ong b997fb45bf Removed unnecessary lines from test_job.py. 11 years ago
Selwin Ong 8aa5771646 job.cancel() now deletes dependents_key 11 years ago
Vincent Driessen bb3dc5b0b2 Terminology change: waitlist -> dependents. 11 years ago
Selwin Ong 15c4b562ba Reverse dependency mapping should be a set instead of a list. 11 years ago
Selwin Ong 93e5e552b7 Replaced "after" kwarg with "depends_on". 11 years ago
Selwin Ong fd44ad39d4 Python 3 fixes for job dependency stuff. 11 years ago
Selwin Ong fcfe55fe13 Merge branch 'master' into job_dependency
Conflicts:
	rq/job.py
	rq/queue.py
11 years ago
Vincent Driessen 1274b09115 Use constants in tests, instead of calling more functions. 11 years ago
Vincent Driessen 90fcb6c9d0 PEP8ify. 11 years ago
H. İbrahim Güngör 10bda9684d Pass description parameter to job constructor in order to distinguish job names in queue.jobs or in rq-dashboard. Add related test case. 12 years ago
Alex Morega 328e7611d3 use utf-8 instead of ascii 12 years ago
Alex Morega 8d61d3bf26 port string handling to py3
Redis uses byte values for everything. We save queue names and job
IDs as unicode. So we need to convert every time we get data from redis.
12 years ago
Alex Morega a3b5ce5e46 accomodate py3 imports and builtins 12 years ago
Selwin Ong e7e8579888 Merge branch 'master' of git://github.com/nvie/rq into job_dependency
Conflicts:
	rq/queue.py
12 years ago
Selwin Ong 2e826e2b1f Internally renamed the term "parent" to "dependency". 12 years ago
Selwin Ong 0dfb041383 Simplify enqueue_waitlist by using lpop. 12 years ago
Vincent Driessen a5dff6659c Replace the Calculator fixture by a Number fixture.
This makes the tests a little more realistic, since I want to add a test
for class methods.
12 years ago
Selwin Ong eadc7db29f First stab at writing implementing job dependency. 12 years ago
Selwin Ong 85e9014296 Moved some logic from worker.perform_job() to job.cleanup(). 12 years ago
Selwin Ong f498de57b6 Always call job.save even on synchronous queues so get_current_job doesn't fail 12 years ago
Vincent Driessen 10237ddcb4 Merge branch 'job-access-within-job'
Conflicts:
	CHANGES.md
	rq/job.py
12 years ago
Vincent Driessen 8cb6a21670 Only store custom properties when they're written to the meta dict. 12 years ago
Vincent Driessen 5e80aa27eb Fix comment. 12 years ago
Vincent Driessen 95d3aed98e Store the job ID on the internal stack.
It does so instead of the instance itself.  Still returns the job---the
interface hasn't changed.
12 years ago
Vincent Driessen 372de4b45a Implement the get_current_job() function.
This fixes #125.
12 years ago
Vincent Driessen 83369f3b9b Prefer `result` over `return_value`.
`return_value` still is available as a backward-compatible accessor.

This fixes #116.
13 years ago
Selwin Ong a5e6765990 Added "result_ttl" property on jobs that determines how long job results are persisted in Redis. 13 years ago
Vincent Driessen f6e67431d7 Refactor the .enqueue() API to not gobble the timeout kwargs.
This fixes #98.
13 years ago
Vincent Driessen 3a8f30a53e Add test. 13 years ago
Vincent Driessen 604fce99a1 Merge with master. 13 years ago
Selwin Ong 1fb0a1bfac Modified ``Job`` ``save`` and ``refresh`` methods to support persisting
additional ``Job`` attributes into Redis.
13 years ago
Omar Khan 03bd49511d Allow instance methods to be enqueued
Only works for picklable instances
13 years ago
Vincent Driessen b45770cd3c Fix unit test expressions. 13 years ago
Vincent Driessen 98ea29b15a Don't expose the Job class at the top-level.
This partially fixes #37.
13 years ago
Vincent Driessen 2b6101d110 Move job from Worker to Job test suite. 13 years ago
Vincent Driessen 15342f14d3 Store pickled function calls as strings.
This aids unpacking in the case of a function that isn't importable from
the worker's runtime. The unpickling will now (almost) always succeed,
and throw an ImportError later on, when the function is actually
accessed (thus imported implicitly).

The end result is a job on the failed queue, with exc_info describing
the import error, which is tremendously useful.
13 years ago
Vincent Driessen e807748ee6 Test the timing out of jobs.
Really looking for a way to speed up this test.  It takes up a whole
second doing nothing now, really.
13 years ago
Vincent Driessen f07d28db86 Organize test fixtures into a separate file. 13 years ago
Vincent Driessen 5717a0ba15 Rename Job.for_call() -> Job.create().
This fixes #34.
13 years ago
Vincent Driessen 7e0b843d06 Implement requeue() method on FailedQueue. 13 years ago
Vincent Driessen 8e85c7eee3 Put Job directly in the top-level `rq` module. 13 years ago
Vincent Driessen 53f55ba986 Flake8 style fixes in the test suite. 13 years ago
Vincent Driessen 7bda1ca969 Encapsulate the result property (it should not directly be set). 13 years ago
Vincent Driessen 8da204f74a Always use cPickle, never 'regular' pickle.
This fixes #18.
13 years ago
Vincent Driessen 9318825429 Abstract away from the concrete pickle implementation.
Choose cPickle, if available, for best performance.
13 years ago
Vincent Driessen 7c903e45ef Simplify the persistence of jobs.
Fixes #23 and #24.
13 years ago
Vincent Driessen b1650cb9b9 CHECKPOINT: Second part of the big refactoring.
Jobs are now stored in separate keys, and only job IDs are put on Redis
queues.  Much of the code has been hit by this change, but it is for the
good.

No really.
13 years ago
Vincent Driessen 65105b44c3 CHECKPOINT: Initial part of the big refactor. 13 years ago
Vincent Driessen 0be1cb6ac0 Change the way jobs are pickled.
There is no job tuple anymore, but instead Jobs are picklable by
themselves natively.  Furthermore, I've added a way to annotate Jobs
with created_at and enqueued_at timestamps, to drive any future Job
performance stats.  (And to enable requeueing, while keeping hold of the
queue that the Job originated from.)

This fixes #17.
13 years ago
Vincent Driessen 0503eb2829 Clarified responsibility of the Job class.
The Job itself has nothing to do with queueing and dequeueing, so the
DequeueError wasn't appropriate here, either.
13 years ago
Vincent Driessen 1f64157c38 Broke down tests into multiple files. 13 years ago