295 Commits (92cf6f4696912e717965ce35c5670d5a83ec2d8f)

Author SHA1 Message Date
orangain e8165fdddf Accept byte strings as the first argument of Worker() in Python 2
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'])
10 years ago
Christophe Olinger 2be468a404 - Rename paramter both in redis and python to shutdown_requested_date
- Use connection instead of pipeline
10 years ago
Christophe Olinger ae27ce9871 Merge branch 'master' into warmshutdown 10 years ago
Christophe Olinger 3e586bd6d6 Add remove current_job based on the correct upstream master branch 10 years ago
Christophe Olinger d622f47aff Save date in redis on which worker receives a warm shutdown request while busy 10 years ago
SkyLothar f9978bc27c make sure state text_type 10 years ago
Selwin Ong 45addbcaf2 Deleted job.set_started_at_now. 10 years ago
Selwin Ong 5afd1a90e5 Merge pull request #589 from samuelcolvin/job-started_at
add job.started_at
10 years ago
Samuel Colvin 6fc34dc6a6 moving started_at to prepare_job_execution 10 years ago
Michael Keirnan 14723ecc1f Merge remote-tracking branch 'upstream/master' 10 years ago
glaslos a424d320a8 log.info added when cleaning registries 10 years ago
horida 04987a80da mark as busy before forking horse 10 years ago
Selwin Ong 95f740299a Merge pull request #588 from samuelcolvin/logging-extras
more info in 'Job OK' log entry
10 years ago
Samuel Colvin 082e61a212 add job.started_at 10 years ago
Samuel Colvin 30c29614c6 more info in 'Job OK' log entry 10 years ago
Samuel Colvin e750134e8a move request_(force_)stop out of _install_signal_handlers 10 years ago
Selwin Ong 544f2e6fb2 Fixed result logging call . 10 years ago
Selwin Ong 2140cc4fab Job result should be converted to text before being logged. 10 years ago
Toms Bauģis 5a4f297134 do not truncate result output as that can be done in the log formatter 10 years ago
Michael Keirnan bad054989d export worker id and job id to env of work horse
For tracing job execution in a distributed system it is useful to tag log
entries with the worker id and job id. The current job is accessible
via get_current_job(), but that requires an extra redis connection. And
the current worker id (the worker id of the parent process) does not appear
to be available.

Rather than introducing an `rqworker` alternative or subclassing Worker, it
feels simple and efficient to make these contextual ids available as
environment variables. This should have no performance cost and no
API compatibility issues.

Some useful things to do with these values in the worker horse process:

+ include them in log messages
+ include them as 'x-' headers in HTTP requests made by workers
10 years ago
Toms Bauģis ade154575e fix travis error - python 2.6 or whatevs wants positions spelled out for .format 10 years ago
Toms Bauģis 682d4adb40 log result in DEBUG level and truncate to 2k symbols 10 years ago
Selwin Ong cf20f1d9b2 Merge pull request #576 from jlopex/ensure_custom_handlers_are_called
Ensure custom exception handlers call when Redis is down
10 years ago
Vincent Driessen c1a4780d10 Fix PEP8 complaints 10 years ago
Javier Lopez 4fb59a4ceb Ensure custom exception handlers calls when Redis is down 10 years ago
Selwin Ong e6a499ada8 Merge pull request #561 from selwin/async-bug
Sync jobs should be cleaned up after execution.
11 years ago
Selwin Ong edd139d86f Sync jobs should be cleaned up after execution. 11 years ago
Selwin Ong cdcea84105 Merge pull request #557 from selwin/exception_handling
Exception handling
11 years ago
Selwin Ong 3c3646cf91 Merge branch 'master' into exception_handling
Conflicts:
	tests/fixtures.py
11 years ago
mozillazg 7198b4568a Fixed a format error 11 years ago
Vincent Driessen 0de225ec62 Emphasize private nature of `stopped` property 11 years ago
Vincent Driessen ec0e04727b Rename `maintenance_date` -> `last_cleaned_at` 11 years ago
Vincent Driessen 891be55b87 Clean up Worker.__init__ logic a little 11 years ago
Vincent Driessen 4d0ae5da98 Clean up type checking of Worker constructor 11 years ago
Vincent Driessen 94258761ae Make string formatting consistent 11 years ago
Selwin Ong f370f79819 Merge pull request #534 from selwin/registry-maintenance
Worker automatically cleans job registries every hour
11 years ago
Selwin Ong c3767e28e2 Worker now runs maintenance tasks every hour and on startup. 11 years ago
Selwin Ong 5782ac10c4 Added worker.clean_registries(). 11 years ago
RyanMTB 9a00b0eca6 Updated Worker API 11 years ago
Selwin Ong d51f0200d7 Merge pull request #513 from trevorprater/master
Improving logging.
11 years ago
Cosmin Stefan 260f7caf66 Enable proper setup of signale handlers for SimpleWorker as well. fixes #523
This allows a SIGTERM to make the worker perform a warm shutdown and cleanly break out of the loop and finish the current job, if any.
11 years ago
Trevor Prater 5674edad61 Changed rqworker shutdown message.
- As requested by @nvie and @selwin.
11 years ago
Trevor Prater fd1dca40b9 Improving logging.
- Include worker key in worker startup log statement.
- Added a notification to make it more clear when a 'burst' worker dies.
11 years ago
Vincent Driessen 5cb873b438 Fix PEP8 complaint. 11 years ago
Mark LaPerriere 636a537fa7 updates addressing @selwin comments for PR #465 11 years ago
Bradley Young 04e403e1a3 dread comma, I adjure thee. 11 years ago
Bradley Young d56b5424c8 merging master and fixing conflicts 11 years ago
Bradley Young c428f955e4 per @selwin, adding a deprecated handler for exc_handler 11 years ago
Mark LaPerriere a4ca4704ac convert redis returned bytes into text/string 11 years ago
Mark LaPerriere cfe3da287a updated branch to latest 11 years ago
Vincent Driessen b8d425b318 Various PEP8 fixes. 11 years ago
Vincent Driessen fac2b10309 Auto-sort imports using isort. 11 years ago
Bradley Young f05d77b92b changing "default" for exception_handlers to None; same exact logic can be implemented, but cleaner 11 years ago
Bradley Young d3e4fb567b merge && updates to add multiple exception handlers. 11 years ago
Bradley Young f575137612 updating worker to have exception_handlers 11 years ago
Vincent Driessen dc5cd514ee Explicitly cast map() result to a list, for Python 3 compat. 11 years ago
Selwin Ong dc09676ee0 Minor copywriting fixes. 11 years ago
Selwin Ong 01ab2f20dd Minor copywriting fixes. 11 years ago
Vincent Driessen 543bcbc60b Explicitly cast map() result to a list, for Python 3 compat. 11 years ago
Selwin Ong eae2c40ea0 Merge pull request #457 from jlopex/block_until_horse_finishes
Make parent worker process wait until horse process finishes
11 years ago
Mark LaPerriere e6c32edad9 add birth_date and death_date properties to Worker 11 years ago
Jonathan Tushman 1ae5a12a81 merging master 11 years ago
Vincent Driessen cd0c3c9c1e Merge pull request #462 from conslo/worker-hash
Worker hash
11 years ago
Jonathan Tushman 82333d2ad5 triggering shutdown by setting a redis flag 11 years ago
Travis Johnson 0ad4cb3410 comments 11 years ago
Travis Johnson c301369c2e implement __eq__ and __hash__ for workers 11 years ago
Javier Lopez fc5295edfc Set busy state on parent while waiting for horse 11 years ago
glaslos 55c541bc59 added job ttl to queue.enqueue() 11 years ago
Bradley Young 5caccaabfe Adding optional list handling to the exc_handler option in Worker.
Adding command line --exception_handler option (with multiple entries allowed) to `rq worker`
Added tests for command line options.
11 years ago
Nic Cope de0b501823 Pass the default worker connection into the started and finished registries
In practice all the registry methods are called with pipelines, but if no
connection is passed in when instantiating the registry and the connection
stack is empty resolve_connection will raise NoRedisConnectionException.
11 years ago
Selwin Ong 2307bc8253 Added FinishedJobRegistry to monitor finished jobs. 11 years ago
Vincent Driessen 783b6f9ec7 Fix PEP8 complaint. 11 years ago
Vincent Driessen 7686785d61 Merge branch 'selwin-working-queue'
Conflicts:
	tests/test_worker.py
11 years ago
Vincent Driessen 4b7c59d68d Fix PEP8 complaints. 11 years ago
Selwin Ong 9341a4a33d Renamed WorkingQueue to StartedJobRegistry. 11 years ago
Selwin Ong 60c7a3cc6e working_queue.remove call should be pipelined. 11 years ago
Selwin Ong 4d90cc062e Add job to WorkingQueue before execution and remove from WorkingQueue after. 11 years ago
Selwin Ong b0c0a84ab0 Moved some logic into worker.prepare_job_execution to make things testable. 11 years ago
foxx 52c3ad0fbf Renamed to SimpleWorker 11 years ago
foxx 16ee71f26d Use class for test worker, and performs PID check in unit tests, #412 11 years ago
Selwin Ong 7cf8ef42d1 Don't pass "args" into logging call. 11 years ago
Selwin Ong b05c2052e1 Capture more data when logging errors. 12 years ago
Vincent Driessen 865efd6e8c Leave setting the state to the worker, not the Job itself.
Should fix #389.
12 years ago
Vincent Driessen d37f49f643 Merge branch 'andrewsg-warnings' 12 years ago
Selwin Ong 7ac1c3500a Worker.__init__ should accept custom job class. 12 years ago
Andrew Gorcester 17a4ed056d use warnings.warn() instead of raise for DeprecationWarning 12 years ago
Vincent Driessen 83382f51d0 PEP8ify. 12 years ago
Vincent Driessen c263f8f600 Fix regression introduced in 0.4.3. 12 years ago
Vincent Driessen b048e23875 Merge pull request #342 from friedcell/master
make job class dynamic
12 years ago
Vincent Driessen ab9e6b852e Fix PEP8 complaints. 12 years ago
Vincent Driessen 38ec259b6e Enable the most modern Python syntax. 12 years ago
Marko Mrdjenovic 5cba260cca Job and Queue classes as variables (compatible with existing naming) 12 years ago
Tomas Hanacek 6494233058 rqworker default arguments of socket, worker_ttl, results_ttl bugfix 12 years ago
Selwin Ong 7eb6c2ab9f Job timeouts are now handled by "worker.death_penalty_class". 12 years ago
Selwin Ong 835c353380 Job status should be updated during job.perform(). 12 years ago
Selwin Ong 57990fa052 Simplify worker.work() by moving some functionalities to relevant methods. 12 years ago
Selwin Ong f5c3c9a6dd Deprecate job.status. 12 years ago
Selwin Ong 72457d2286 Added DeprecationWarning to worker.state. 12 years ago
Selwin Ong 2fe5d9e25e Python 3 compatibility with worker.get_current_job(). 12 years ago
Selwin Ong 802ecb5ccb Renamed worker.set_job_id() and worker.get_job_id() for consistency. 12 years ago