Skip to content

Commit

Permalink
Adding comment to set_schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
bvandenbos committed Jun 9, 2011
1 parent 28529a8 commit afd567b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/resque_scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ module ResqueScheduler
#
# Accepts a new schedule configuration of the form:
#
# {some_name => {"cron" => "5/* * * *",
# {'some_name' => {"cron" => "5/* * * *",
# "class" => DoSomeWork,
# "args" => "work on this string",
# "description" => "this thing works it"s butter off"},
# ...}
#
# :name can be anything and is used only to describe the scheduled job
# 'some_name' can be anything and is used only to describe and reference
# the scheduled job
# :cron can be any cron scheduling string :job can be any resque job class
# :every can be used in lieu of :cron. see rufus-scheduler's 'every' usage for
# valid syntax. If :cron is present it will take precedence over :every.
Expand Down Expand Up @@ -59,7 +60,15 @@ def get_schedules
end
end

# create or update a schedule with the provided name and configuration
# Create or update a schedule with the provided name and configuration.
#
# Note: values for class and custom_job_class need to be strings,
# not constants.
#
# Resque.set_schedule('some_job', {:class => 'SomeJob',
# :every => '15mins',
# :queue => 'high',
# :args => '/tmp/poop'})
def set_schedule(name, config)
existing_config = get_schedule(name)
unless existing_config && existing_config == config
Expand Down

0 comments on commit afd567b

Please sign in to comment.