diff --git a/lib/resque_scheduler.rb b/lib/resque_scheduler.rb index c9c7fd14..3d6010df 100644 --- a/lib/resque_scheduler.rb +++ b/lib/resque_scheduler.rb @@ -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. @@ -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