Permalink
Browse files

Adding support for empty crons in the schedule

  • Loading branch information...
Ben VandenBos
Ben VandenBos committed Feb 11, 2010
1 parent 9da44a7 commit 0c210e90c651feee25777112bd947340f8e97b14
Showing with 14 additions and 4 deletions.
  1. +6 −0 HISTORY.md
  2. +7 −3 lib/resque/scheduler.rb
  3. +1 −1 lib/resque_scheduler/version.rb
View
@@ -1,3 +1,9 @@
+## 1.0.3 (2010-02-11)
+
+* Added support for scheduled jobs with empty crons. This is helpful to have
+ jobs that you don't want on a schedule, but do want to be able to queue by
+ clicking a button.
+
## 1.0.2 (2010-02-?)
* Change Delayed Job tab to display job details if only 1 job exists
View
@@ -50,9 +50,13 @@ def load_schedule!
Resque.schedule.each do |name, config|
log! "Scheduling #{name} "
- rufus_scheduler.cron config['cron'] do
- log! "queuing #{config['class']} (#{name})"
- enqueue_from_config(config)
+ if !config['cron'].nil? && config['cron'].length > 0
+ rufus_scheduler.cron config['cron'] do
+ log! "queuing #{config['class']} (#{name})"
+ enqueue_from_config(config)
+ end
+ else
+ log! "not cron found for #{config['class']} (#{name}) - skipping"
end
end
end
@@ -1,3 +1,3 @@
module ResqueScheduler
- Version = '1.0.2'
+ Version = '1.0.3'
end

0 comments on commit 0c210e9

Please sign in to comment.