Commit Graph

321 Commits (6b0ebe9ceb6f8b0ce53cfaf15d59acf87af12e5a)
 

Author SHA1 Message Date
Vincent Driessen f47398a754 Ditch false code size claim.
Vincent Driessen fb587297f6 Requeue should not error when called on a deleted job ID.
Vincent Driessen 7ef3b5ade8 Cleanup job hashes for jobs without result, too.
Vincent Driessen f07d28db86 Organize test fixtures into a separate file.
Vincent Driessen 5717a0ba15 Rename Job.for_call() -> Job.create().
This fixes .
Vincent Driessen 7e0b843d06 Implement requeue() method on FailedQueue.
Vincent Driessen 8e85c7eee3 Put Job directly in the top-level `rq` module.
Vincent Driessen 240d2d941d Extracted method.
This makes the act of moving failed jobs to the failed queue
responsibility of the FailedQueue itself, not of the Worker.

This fixes .
Vincent Driessen d64ad225eb Make FailedQueue a full subclass of Queue.
We will add special methods on it in the future.

This fixes .
Vincent Driessen 6f05e03293 Clean up some of the dummy jobs used for testing.
Also, add a random_failure test.
Vincent Driessen f62e295454 Ignore autoenv file.
Vincent Driessen 06ce9622ea Add compact() method on Queues, to remove dead messages.
Vincent Driessen 80a615a61c Flake8 style fixes.
Vincent Driessen 70cbf00890 Refactor out an exists() and a for_key() method.
Vincent Driessen c49e564d3c Don't break the API when jobs get deleted.
Vincent Driessen bd08f24f15 Cosmetic changes to the command line output.
Vincent Driessen e4055ca42f Allow queues to be emptied.
Vincent Driessen 9e33e1a08f Implement a cancel() method on jobs.
This fixes .
Vincent Driessen 53f55ba986 Flake8 style fixes in the test suite.
Vincent Driessen 0a0d9d1ceb Flake8 style fixes.
Vincent Driessen 1a8b80604d Minor refactoring to make the to-failed queue code a bit more readable.
Vincent Driessen 11c7dbb376 Consistently renamed "failure" -> "failed" queue.
Fixes .
Vincent Driessen 9f5b1545b6 Fix: store the job result in the correct key.
And expire job hash in Redis after 500 seconds (by default).

Fixes .
Vincent Driessen 7bda1ca969 Encapsulate the result property (it should not directly be set).
Vincent Driessen 6266f68310 Style fixes (flake8).
Vincent Driessen 10c48e1dbd Merge branch 'use-cpickle'
Vincent Driessen 8da204f74a Always use cPickle, never 'regular' pickle.
This fixes .
Vincent Driessen 9318825429 Abstract away from the concrete pickle implementation.
Choose cPickle, if available, for best performance.
Vincent Driessen c4553f2a22 Merge branch 'rewrite-data-model'
Vincent Driessen abc66171eb Simplify the count_words_at_url example.
The long implementation derived attention a bit from the actual point of
enqueuing here.
Vincent Driessen 39f106cdb3 Have the test suite find an empty Redis database.
Since the test suite `flushdb()`'s after running each test, we should
make sure the database is empty before we even start running tests.
This patch will make sure to never destroy any local production data
inside the running Redis instance.

This fixes .
Vincent Driessen 90a458ca8e Add more colorful terminal output.
For better visual parsability.
Vincent Driessen 63ef198fd6 Improve work generator.
Vincent Driessen 791f8169f5 Remove dead code.
Vincent Driessen e05acfedce Fix putting jobs on the failure queue when they fail.
Vincent Driessen 7c903e45ef Simplify the persistence of jobs.
Fixes  and .
Vincent Driessen bffe6cbbde Encapsulate internal function call representation.
This means it's not allowed anymore to directly set func, args, and
kwargs.  Instead, use the for_call() constructor.
Vincent Driessen 370399f8f7 CHECKPOINT: dequeue_any now returns the queue that was popped from.
Vincent Driessen f516f8df2e CHECKPOINT: Handle failing and unreadable jobs.
Failing (or unreadable) jobs are correctly put on the failure queue by
the worker now.
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.
Vincent Driessen 65105b44c3 CHECKPOINT: Initial part of the big refactor.
Vincent Driessen 7fff52d99c Get rid of ugly custom assertion.
Vincent Driessen fcca48a9d7 Rename empty property -> is_empty() method.
Vincent Driessen 9986fee00e Pass test output through rg.
Vincent Driessen 4d2f64d4b6 Mental note to self.
Vincent Driessen 20e908039f Initially set the exc_info property, so it does not raise an
AttributeException when accessed.
Vincent Driessen fdce187c27 Putting failed jobs on the failure queue.
Vincent Driessen 7eb8d92605 Put unreadable tasks on the failure queue.
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 .
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.