Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: gawin/delayed_job
base: master
...
head fork: guns/delayed_job
compare: delayed_job_daemon
Checking mergeability… Don't worry, you can still create the pull request.
Commits on Aug 17, 2010
guns Add task jobs:daemon:start, which spawns a simple forking daemon that…
… actually works

The command

        $ WORKERS=n RAILS_ENV=production rake jobs:daemon:start

spawns a simple forking daemon, which spawns and restarts `n' instances of
Delayed::Worker. Worker processes are revived by the master process on receipt
of SIGCLD.

We can restart worker instances by sending SIGHUP to the master process or by
killing them directly. Sending SIGTERM, SIGINT, or SIGQUIT to the master
instructs it to kill its children and terminate.

Alternately, there are the tasks `jobs:daemon:restart' and `jobs:daemon:stop'

Two extra features:

* To avoid CPU thrashing, if a child worker dies 4 times in 60 seconds, a
  warning message is logged and the child sleeps for 300 seconds before
  booting up

* The master polls tmp/restart.txt and restarts children on timestamp update
031efe6
guns add the MAX_PRIORITY and MIN_PRIORITY envvars to worker initialization 8094bbf
Commits on Aug 21, 2010
@noriaki noriaki Fixed daemon_tasks load-path. 7a99461
guns Merge remote branch 'noriaki/delayed_job_daemon' into delayed_job_daemon acfb396
Commits on Aug 24, 2010
guns match Delayed::Worker timestamp style 7221810
Commits on Sep 04, 2010
@markbates markbates Added before/after hooks around perform. d6710f5
@markbates markbates Broke callbacks out into before, after, success, and failure. 50d0d80
@bkeepers bkeepers RIP Merb 962afc5
@bkeepers bkeepers Extract Mongoid backend into its own plugin. See http://github.com/co… c7d16ab
Commits on Sep 05, 2010
@bkeepers bkeepers Remove MongoMapper backend
MongoMapper is not compatible with Rails 3 yet. When it is, someone can resurrect this code in a separate gem like the other backends.
1815f28
@bkeepers bkeepers Fix active_record specs df9cf7e
@bkeepers bkeepers Extract Mongoid backend into its own gem. See http://github.com/colle… b025184
@bkeepers bkeepers Remove couch backend
Whoever wants to maintain it is welcome to resurrect this backend as a separate gem similar to the datamapper and mongoid backends
1b4eb42
@bkeepers bkeepers Clean up after extracting backends 82bfcbc
@bkeepers bkeepers Remove jeweler and use Bundler to lock dependencies 40fabf3
@bkeepers bkeepers Link to wiki for info on other backends 63f88d5
guns Merge remote branch 'collectiveidea/master' into delayed_job_daemon
Conflicts:
	lib/delayed/tasks.rb
4c3e1c9
@bkeepers bkeepers Fix activesupport dependency ffbf53a
@bkeepers bkeepers Only set backend if one is not already set 77b0482
Commits on Sep 06, 2010
guns Merge remote branch 'collectiveidea/master' into delayed_job_daemon ec9423d
@bkeepers bkeepers remove rails 2 support. delayed_job 2.1 will only support Rails 3 b9b38f6
@bkeepers bkeepers Include Rails as a development dependency 129b612
@bkeepers bkeepers Refactor hooks a7751a8
@bkeepers bkeepers Update docs on hooks 129a5d5
@bkeepers bkeepers Added cleaner API for delaying mailers in Rails 3
Example:
	UserMailer.delay.signup(@user)

This will enqueue a job that creates the email and calls #deliver on it.
33be987
@eugenebolshakov eugenebolshakov Updated readme 7a4ed0d
@bkeepers bkeepers Make worker quiet by default f91dda3
@bkeepers bkeepers Remove a few other traces of Rails 2 7232cf1
@bkeepers bkeepers Don't require Rails and ActionMailer since delayed_job can be used in…
… plain ol' ruby apps with Active Record
fa5aab7
@bkeepers bkeepers remove old init.rb from gemspec 2bcbb50
Commits on Sep 07, 2010
guns fix comment typo 65e58c5
guns Merge remote branch 'collectiveidea/master' into delayed_job_daemon 6f63660
guns temporary fix for http://github.com/collectiveidea/delayed_job/issues…
…/issue/113

rename PerformableMethod#method -> #delayed_method to avoid overriding
Object#method
ecfc1e4
Commits on Sep 08, 2010
@bkeepers bkeepers Remove arg from sample job 1b5c586
@bkeepers bkeepers load active_record and action_mailer before requiring delayed_job 0af736e
Commits on Sep 09, 2010
@bkeepers bkeepers Added #enqueue hook 3e8a196
@bkeepers bkeepers Don't depend on arity, which returns negative numbers when there are …
…variable arguments
5dc030e
@bkeepers bkeepers Added ruby-debug to development dependencies 0278846
@bkeepers bkeepers Update Delayed::Job.enqueue to take a hash 2cc1573
@bkeepers bkeepers Fix hooks on PerformableMethod and PerformableMailer [Closes #113] e132b5d
@bkeepers bkeepers Update spec 83fe8d8
guns Merge remote branch 'collectiveidea/master' into delayed_job_daemon 8bc1abd
guns add more comments for clarity
Also ensure that File.umask = 0022; forgot that parent shell could have
reset umask to something silly.
62272eb
guns move #kill_master out from outer scope and into an instance_eval e196028
guns Revert "temporary fix for http://github.com/collectiveidea/delayed_jo…
…b/issues/issue/113"

This reverts commit ecfc1e4.
76795ea
guns Merge branch 'delayed_job_daemon' into guns 1c73fd3
Commits on Sep 11, 2010
@bkeepers bkeepers DRY up Gemfile d04dd79
Commits on Sep 13, 2010
@bkeepers bkeepers Require activesupport delegation b15e93d
@bkeepers bkeepers Fix spec to use API method instead of #reload a92ee5c
Commits on Sep 14, 2010
@bkeepers bkeepers Use ActiveRecord::Base.establish_connection to reconnect after forking 0b866f9
@danielmorrison danielmorrison Added note about Rails versions to the README. 234fcf8
Commits on Sep 15, 2010
guns Merge remote branch 'collectiveidea/master' into delayed_job_daemon 4b52cbc
guns Merge branch 'delayed_job_daemon' into guns 706aa8b
Commits on Sep 17, 2010
guns KISS and check to see if the file exists before checking its mtime
Fixes bug where the master would constantly raise SIGHUP when
'restart.txt' didn't exist
9b8bf90
guns Merge branch 'delayed_job_daemon' into guns c7bc0e5
Commits on Sep 22, 2010
@giddie giddie Only remove the PID file when the master process is *actually* termin…
…ating.
ef64bbe
guns explicitly exit(0) on SIGTERM; keep it simple and trap less signals
Thanks to Brandon Keepers and Paul Gideon Dann for reporting that
`Process.kill :TERM, $$' does not work reliably.

For now, we will just exit(0) since that really won't do any harm.

Also, removed unnecessary traps on INT and QUIT.
b947840
guns rename rails_logger -> logger; more comments 980dacf
guns Merge branch 'delayed_job_daemon' into guns 3409b0d
Commits on Sep 23, 2010
@betamatt betamatt Changed @@sleep_delay to self.class.sleep_delay to be consistent with…
… other class variable usage
7093c26
@betamatt betamatt Add support for sleep_delay command line option 34fc406
@betamatt betamatt Reschedule jobs using a time provided by the handler, or fall back to…
… default
1fea4b0
@betamatt betamatt Remove broken spec that should not have been committed 92d7e31
Commits on Sep 26, 2010
@bkeepers bkeepers Use mysql to run specs dca7dd7
@bkeepers bkeepers Update benchmark to just run AR backend 4add3ba
David Genord II Added options to handle_asynchronously 4784f9d
Commits on Sep 27, 2010
@bkeepers bkeepers Merge remote branch 'Viximo/rescheduling'
* Viximo/rescheduling:
  Remove broken spec that should not have been committed
  Reschedule jobs using a time provided by the handler, or fall back to default
4a98683
@bkeepers bkeepers Merge remote branch 'Viximo/ci-sleep-patch'
* Viximo/ci-sleep-patch:
  Add support for sleep_delay command line option
  Changed @@sleep_delay to self.class.sleep_delay to be consistent with other class variable usage
aba9905
Commits on Oct 04, 2010
guns Merge remote branch 'collectiveidea/master' into guns e046e91
guns reset :EXIT trap for children; dying children were incorrectly removi…
…ng master pid file
15678f4
guns Merge branch 'guns' into delayed_job_daemon 6b86241
guns reset child death log when user restarts daemon 6e63dc8
guns update comments to reflect change in signal handling 194291d
Commits on Oct 13, 2010
@edwinv edwinv Add delayed_job_args variable for Capistrano recipe to allow configur…
…ation of started workers (e.g. "-n 2 --max-priority 10")
08e498f
Commits on Oct 15, 2010
@jorgemanrubia jorgemanrubia Changed the way the error message is composed when a job fails. Whith…
… the previous implementation, if the raised error has a nil message, it will fail with a `<NoMethodError: undefined method '+' for nil:NilClass>`. Now it is using normal Ruby interpolation that will default to an empty String with nil messages.

Having an exception with a nil message is not a normal Ruby behaviour (Exceptions usually default to its class name when no message is provided), but it is possible. I am experiencing this problem because I am using the Ruby EDAM implementation of a commercial API, that doesn't set a message for its errors. The problem with delayed_job is quite serious, since it makes the jobs worker to crash completely (it kills the process).
2b23b80
Commits on Oct 28, 2010
@iamnader iamnader added log_queries option, which if set to false will silence the db q…
…ueries from showing up in the log every 5 seconds
2c42671
@iamnader iamnader forgot to commit a method 6797944
@iamnader iamnader forgot to commit a method f054208
Commits on Nov 07, 2010
@iamnader iamnader fixing documentation typo 2293667
Commits on Nov 12, 2010
@bkeepers bkeepers Merge branch 'master' of https://github.com/jorgemanrubia/delayed_job
* 'master' of https://github.com/jorgemanrubia/delayed_job:
  Changed the way the error message is composed when a job fails. Whith the previous implementation, if the raised error has a nil message, it will fail with a `<NoMethodError: undefined method '+' for nil:NilClass>`. Now it is using normal Ruby interpolation that will default to an empty String with nil messages.
6e8b218
@bkeepers bkeepers quiet down the specs 6d654ce
@bkeepers bkeepers Merge branch 'master' of https://github.com/bluetools/delayed_job
* 'master' of https://github.com/bluetools/delayed_job:
  Add delayed_job_args variable for Capistrano recipe to allow configuration of started workers (e.g. "-n 2 --max-priority 10")
d5beb84
@bkeepers bkeepers rescue argument error when deserializing job b64962d
@bkeepers bkeepers upgrade to rspec2 def384c
@bkeepers bkeepers Added Delayed::Job.reserve for a cleaner way to find and lock one ava…
…ilable job
1febad8
@bkeepers bkeepers fix deprecation warnings 488aaae
@bkeepers bkeepers Use new #reserve method in the worker 8e09ec0
@bkeepers bkeepers remove log_queries option. It will be replaced with better logger set…
…tings
626b5e2
@bkeepers bkeepers whitespace b0e1c7e
@bkeepers bkeepers move around serialization code 7b00063
@bkeepers bkeepers raise deserialization error when active record is not found 09bab8a
@bkeepers bkeepers rescue DeserializationError and mark job as failed
Closes #77
e090d3f
@bkeepers bkeepers Rework yaml serialization to make it less obtrusive cbde340
Commits on Nov 13, 2010
@bkeepers bkeepers Update README 3ff9711
@bkeepers bkeepers Added CHANGELOG e532041
@bkeepers bkeepers update README 3655aab
@bkeepers bkeepers update link to v2.0 branch in README 1a39108
@bkeepers bkeepers Fix issue where dirty tracking prevented job from being properly unlo…
…cked

Closes #63
e03a584
Commits on Nov 15, 2010
@bkeepers bkeepers Prepare for 2.1.0 release 5cbc4b3
@bkeepers bkeepers Fix #reserve method to call Worker#name c03b065
@bkeepers bkeepers failing spec for serialization issue f99439a
@bkeepers bkeepers Revert serialization refactoring that had some major issues
This reverts commit cbde340.
ffd1173
@bkeepers bkeepers Prepare for 2.1.1 release fcca64c
Commits on Nov 24, 2010
@bkeepers bkeepers bundle update 8787a11
@bkeepers bkeepers Update shared spec to only call #reserve method on job
#reserve will become part of the public backend API. Other backends can still implement #find_available and #lock_exclusively and call them, but they must implement #reserve.
f4fc9a2
Commits on Nov 27, 2010
guns Merge remote branch 'collectiveidea/master' into delayed_job_daemon 324ce6e
Commits on Dec 27, 2011
@guns guns Patch DJ's monkey patch of YAML's monkey patch for Ruby 1.9.3 f8d3cf7
Commits on Feb 02, 2012
@pda pda Force YAML to use syck rather than psych. Eventually delayed_job shou…
…ld be made compatible with both.
4007069
@pda pda Guard against attempting YAML::ENGINE.yamler = "syck" in older rubies. 823fb2e
Commits on Feb 10, 2012
@guns guns Remove extant pid files with a warning.
Restarting workers on boot after a sudden shutdown was problematic.
55bed32