resque-scheduler 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of resque-scheduler might be problematic. Click here for more details.

@@ -0,0 +1,120 @@
1
+ # This configuration was generated by `rubocop --auto-gen-config`.
2
+ # The point is for the user to remove these configuration records
3
+ # one by one as the offences are removed from the code base.
4
+
5
+ AccessControl:
6
+ Enabled: false
7
+
8
+ AlignParameters:
9
+ Enabled: false
10
+
11
+ AssignmentInCondition:
12
+ Enabled: false
13
+
14
+ CaseEquality:
15
+ Enabled: false
16
+
17
+ ClassVars:
18
+ Enabled: false
19
+
20
+ CollectionMethods:
21
+ Enabled: false
22
+
23
+ ColonMethodCall:
24
+ Enabled: false
25
+
26
+ CommentAnnotation:
27
+ Enabled: false
28
+
29
+ Documentation:
30
+ Enabled: false
31
+
32
+ EmptyLines:
33
+ Enabled: false
34
+
35
+ Encoding:
36
+ Enabled: false
37
+
38
+ FavorUnlessOverNegatedIf:
39
+ Enabled: false
40
+
41
+ FavorUntilOverNegatedWhile:
42
+ Enabled: false
43
+
44
+ HandleExceptions:
45
+ Enabled: false
46
+
47
+ HashSyntax:
48
+ Enabled: false
49
+
50
+ IfUnlessModifier:
51
+ Enabled: false
52
+
53
+ LineLength:
54
+ Enabled: false
55
+
56
+ Loop:
57
+ Enabled: false
58
+
59
+ MethodCallParentheses:
60
+ Enabled: false
61
+
62
+ MethodLength:
63
+ Enabled: false
64
+
65
+ ModuleFunction:
66
+ Enabled: false
67
+
68
+ NumericLiterals:
69
+ Enabled: false
70
+
71
+ ParenthesesAroundCondition:
72
+ Enabled: false
73
+
74
+ PerlBackrefs:
75
+ Enabled: false
76
+
77
+ RedundantBegin:
78
+ Enabled: false
79
+
80
+ RescueException:
81
+ Enabled: false
82
+
83
+ RescueModifier:
84
+ Enabled: false
85
+
86
+ SingleLineMethods:
87
+ Enabled: false
88
+
89
+ SpaceAfterComma:
90
+ Enabled: false
91
+
92
+ SpaceAroundBlockBraces:
93
+ Enabled: false
94
+
95
+ SpaceAroundEqualsInParameterDefault:
96
+ Enabled: false
97
+
98
+ SpaceAroundOperators:
99
+ Enabled: false
100
+
101
+ SpaceInsideHashLiteralBraces:
102
+ Enabled: false
103
+
104
+ SpecialGlobalVars:
105
+ Enabled: false
106
+
107
+ StringLiterals:
108
+ Enabled: false
109
+
110
+ TrailingBlankLines:
111
+ Enabled: false
112
+
113
+ TrailingWhitespace:
114
+ Enabled: false
115
+
116
+ TrivialAccessors:
117
+ Enabled: false
118
+
119
+ UselessAssignment:
120
+ Enabled: false
@@ -0,0 +1,10 @@
1
+ ---
2
+ language: ruby
3
+ rvm:
4
+ - ree
5
+ - 1.9.3
6
+ - 2.0.0
7
+ script: bundle exec rake rubocop test
8
+ notifications:
9
+ email:
10
+ recipients: daniel.buch+resque-scheduler@gmail.com
@@ -0,0 +1,59 @@
1
+ Resque Scheduler authors
2
+ ========================
3
+
4
+ - Aaron Suggs
5
+ - Alexander Simonov
6
+ - Ben VandenBos
7
+ - Bernerd Schaefer
8
+ - Bogdan Gusiev
9
+ - Brian Landau
10
+ - Brian P O'Rourke
11
+ - Carlos Antonio da Silva
12
+ - Chris Kampmeier
13
+ - DJ Hartman
14
+ - Damon P. Cortesi
15
+ - Dan Buch
16
+ - Dave Grijalva
17
+ - David Backeus
18
+ - David Balatero
19
+ - David Doan
20
+ - David Yang
21
+ - Denis Yagofarov
22
+ - Evan Tahler
23
+ - Giovanni Cappellotto
24
+ - Henrik Nyh
25
+ - James Le Cuirot
26
+ - John Crepezzi
27
+ - John Griffin
28
+ - Jon Larkowski and Les Hill
29
+ - Jonathan Hyman
30
+ - Jonathan Owens
31
+ - Joshua Szmajda
32
+ - Justin Weiss
33
+ - Les Hill
34
+ - Manuel Meurer
35
+ - Matt Aimonetti
36
+ - Matt Simpson
37
+ - Matteo Centenaro
38
+ - Michael Lovitt
39
+ - Michael Nikitochkin
40
+ - Michael Rykov
41
+ - Nickolas Means
42
+ - Olek Janiszewski
43
+ - Olivier Brisse
44
+ - Petteri Räty
45
+ - Phil Cohen
46
+ - Russell Branca
47
+ - Ryan Biesemeyer
48
+ - Ryan Carver
49
+ - Sebastian Kippe
50
+ - Tim Liner
51
+ - Tony Lewis
52
+ - V Sreekanth
53
+ - andreas
54
+ - bbauer
55
+ - fallwith
56
+ - gravis
57
+ - hpoydar
58
+ - malomalo
59
+ - sawanoboly
@@ -0,0 +1,6 @@
1
+ Resque Scheduler contribution guidelines
2
+ ========================================
3
+
4
+ - Pull requests welcome!
5
+ - Please add yourself to [AUTHORS.md](AUTHORS.md) alphabetically by
6
+ first name.
data/Gemfile CHANGED
@@ -1,9 +1,5 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
+
2
3
  gemspec
3
4
 
4
- group :test do
5
- gem "rake"
6
- gem "rack-test"
7
- gem "yajl-ruby", "~>0.8.2", :platforms => :mri
8
- gem "mocha"
9
- end
5
+ gem 'yajl-ruby', '~> 0.8.2', :platforms => :mri, :group => :test
data/HISTORY.md CHANGED
@@ -1,4 +1,32 @@
1
- ## 2.0.0
1
+ ## 2.1.0 (2013-09-20)
2
+
3
+ * Locking to resque < 1.25.0 (for now)
4
+ * Ensuring `Resque.schedule=` sets rather than appends
5
+ * Process daemonization fixes including stdio redirection and redis client
6
+ reconnection
7
+ * Add `#scheduled_at` which returns an array of timestamps at which the
8
+ specified job is scheduled
9
+ * Syncing stdout/stderr
10
+ * Add `#enqueue_delayed` for enqueueing specific delayed jobs immediately
11
+ * Show server local time in resque-web
12
+ * Enqueue immediately if job is being enqueued in the past
13
+ * Using a logger instead of `#puts`, configurable via `LOGFILE`, `VERBOSE`, and
14
+ `MUTE` environmental variables, as well as being settable via
15
+ `Resque::Scheduler#logger`
16
+ * Fixing scheduler template when arrays are passed to rufus-scheduler
17
+ * Add support for configuring `Resque::Scheduler.poll_sleep_amount` via the
18
+ `INTERVAL` environmental variable.
19
+ * Fixed shutdown in ruby 2.0.0
20
+ * Removed dependency on `Resque::Helpers`
21
+
22
+ ## 2.0.1 (2013-03-20)
23
+
24
+ * Adding locking to support master failover
25
+ * Allow custom job classes to be used in `Resque.enqueue_at`
26
+ * More efficient `#remove_delayed` implementation
27
+ * Allowing `#enqueue_at` to call `#scheduled` when `Resque.inline` is `true`
28
+
29
+ ## 2.0.0 (2012-05-04)
2
30
 
3
31
  * Add support for Resque.inline configuration (carlosantoniodasilva)
4
32
  * Fixing possible job loss race condition around deleting delayed queues
@@ -11,14 +39,14 @@
11
39
  ### 2.0.0.f (2011-11-03)
12
40
 
13
41
  * TODO: address race condition with delayed jobs (using redis transactions)
14
- * Support ENV['BACKGROUND'] flag for daemonizing (bernerdschaefer)
15
- * Added support for before_schedule and after_schedule hooks (yaauie)
16
- * Added remove_delayed_job_from_timestamp to remove delayed jobs from
42
+ * Support `ENV['BACKGROUND']` flag for daemonizing (bernerdschaefer)
43
+ * Added support for `before_schedule` and `after_schedule` hooks (yaauie)
44
+ * Added `remove_delayed_job_from_timestamp` to remove delayed jobs from
17
45
  a given timestamp.
18
46
 
19
47
  ### 2.0.0.e (2011-09-16)
20
48
 
21
- * Adding enqueue_at_with_queue/enqueue_in_with_queue support (niralisse)
49
+ * Adding `enqueue_at_with_queue`/`enqueue_in_with_queue` support (niralisse)
22
50
  * Adding `Resque::Scheduler.poll_sleep_amount` to allow for configuring
23
51
  the sleep time b/w delayed queue polls.
24
52
  * Add a "Clear Delayed Jobs" button to the Delayed Jobs page (john-griffin)
@@ -41,6 +69,13 @@
41
69
  * Dynamic schedule support (brianjlandau, davidyang)
42
70
  * Now depends on redis >=1.3
43
71
 
72
+ ## 1.9.10 (2013-09-19)
73
+
74
+ * Backported `#enqueue_at_with_queue`
75
+ * Locking to resque < 1.25.0
76
+ * Mocha setup compatibility
77
+ * Ruby 1.8 compatibility in scheduler tab when schedule keys are symbols
78
+
44
79
  ## 1.9.9 (2011-03-29)
45
80
 
46
81
  * Compatibility with resque 1.15.0
@@ -53,7 +88,7 @@
53
88
  ## 1.9.7 (2010-11-09)
54
89
 
55
90
  * Support for rufus-scheduler "every" syntax (fallwith)
56
- * Ability to pass a Time to handle_delayed_items for testing/staging (rcarver)
91
+ * Ability to pass a Time to `handle_delayed_items` for testing/staging (rcarver)
57
92
 
58
93
  ## 1.9.6 (2010-10-08)
59
94
 
data/LICENSE CHANGED
@@ -1,4 +1,6 @@
1
- Copyright (c) 2010 Ben VandenBos
1
+ Copyright (c) 2013 Ben VandenBos
2
+
3
+ MIT License
2
4
 
3
5
  Permission is hereby granted, free of charge, to any person obtaining
4
6
  a copy of this software and associated documentation files (the
@@ -1,9 +1,13 @@
1
1
  resque-scheduler
2
2
  ================
3
3
 
4
+ [![Dependency Status](https://gemnasium.com/resque/resque-scheduler.png)](https://gemnasium.com/resque/resque-scheduler)
5
+ [![Gem Version](https://badge.fury.io/rb/resque-scheduler.png)](http://badge.fury.io/rb/resque-scheduler)
6
+ [![Build Status](https://travis-ci.org/resque/resque-scheduler.png?branch=master)](https://travis-ci.org/resque/resque-scheduler)
7
+
4
8
  ### Description
5
9
 
6
- Resque-scheduler is an extension to [Resque](http://github.com/defunkt/resque)
10
+ Resque-scheduler is an extension to [Resque](http://github.com/resque/resque)
7
11
  that adds support for queueing items in the future.
8
12
 
9
13
  This table explains the version requirements for redis
@@ -21,9 +25,11 @@ Scheduled jobs are like cron jobs, recurring on a regular basis. Delayed
21
25
  jobs are resque jobs that you want to run at some point in the future.
22
26
  The syntax is pretty explanatory:
23
27
 
24
- Resque.enqueue_in(5.days, SendFollowupEmail) # run a job in 5 days
25
- # or
26
- Resque.enqueue_at(5.days.from_now, SomeJob) # run SomeJob at a specific time
28
+ ```ruby
29
+ Resque.enqueue_in(5.days, SendFollowupEmail) # run a job in 5 days
30
+ # or
31
+ Resque.enqueue_at(5.days.from_now, SomeJob) # run SomeJob at a specific time
32
+ ```
27
33
 
28
34
  ### Documentation
29
35
 
@@ -38,11 +44,15 @@ To install:
38
44
 
39
45
  If you use a Gemfile, you may want to specify the `:require` explicitly:
40
46
 
41
- gem 'resque-scheduler', :require => 'resque_scheduler'
47
+ ```ruby
48
+ gem 'resque-scheduler', :require => 'resque_scheduler'
49
+ ```
42
50
 
43
51
  Adding the resque:scheduler rake task:
44
52
 
45
- require 'resque_scheduler/tasks'
53
+ ```ruby
54
+ require 'resque_scheduler/tasks'
55
+ ```
46
56
 
47
57
  There are three things `resque-scheduler` needs to know about in order to do
48
58
  it's jobs: the schedule, where redis lives, and which queues to use. The
@@ -52,40 +62,41 @@ probably already have this task, lets just put our configuration there.
52
62
  `resque-scheduler` pretty much needs to know everything `resque` needs
53
63
  to know.
54
64
 
65
+ ```ruby
66
+ # Resque tasks
67
+ require 'resque/tasks'
68
+ require 'resque_scheduler/tasks'
55
69
 
56
- # Resque tasks
57
- require 'resque/tasks'
58
- require 'resque_scheduler/tasks'
59
-
60
- namespace :resque do
61
- task :setup do
62
- require 'resque'
63
- require 'resque_scheduler'
64
- require 'resque/scheduler'
65
-
66
- # you probably already have this somewhere
67
- Resque.redis = 'localhost:6379'
68
-
69
- # If you want to be able to dynamically change the schedule,
70
- # uncomment this line. A dynamic schedule can be updated via the
71
- # Resque::Scheduler.set_schedule (and remove_schedule) methods.
72
- # When dynamic is set to true, the scheduler process looks for
73
- # schedule changes and applies them on the fly.
74
- # Note: This feature is only available in >=2.0.0.
75
- #Resque::Scheduler.dynamic = true
76
-
77
- # The schedule doesn't need to be stored in a YAML, it just needs to
78
- # be a hash. YAML is usually the easiest.
79
- Resque.schedule = YAML.load_file('your_resque_schedule.yml')
80
-
81
- # If your schedule already has +queue+ set for each job, you don't
82
- # need to require your jobs. This can be an advantage since it's
83
- # less code that resque-scheduler needs to know about. But in a small
84
- # project, it's usually easier to just include you job classes here.
85
- # So, something like this:
86
- require 'jobs'
87
- end
88
- end
70
+ namespace :resque do
71
+ task :setup do
72
+ require 'resque'
73
+ require 'resque_scheduler'
74
+ require 'resque/scheduler'
75
+
76
+ # you probably already have this somewhere
77
+ Resque.redis = 'localhost:6379'
78
+
79
+ # If you want to be able to dynamically change the schedule,
80
+ # uncomment this line. A dynamic schedule can be updated via the
81
+ # Resque::Scheduler.set_schedule (and remove_schedule) methods.
82
+ # When dynamic is set to true, the scheduler process looks for
83
+ # schedule changes and applies them on the fly.
84
+ # Note: This feature is only available in >=2.0.0.
85
+ #Resque::Scheduler.dynamic = true
86
+
87
+ # The schedule doesn't need to be stored in a YAML, it just needs to
88
+ # be a hash. YAML is usually the easiest.
89
+ Resque.schedule = YAML.load_file('your_resque_schedule.yml')
90
+
91
+ # If your schedule already has +queue+ set for each job, you don't
92
+ # need to require your jobs. This can be an advantage since it's
93
+ # less code that resque-scheduler needs to know about. But in a small
94
+ # project, it's usually easier to just include you job classes here.
95
+ # So, something like this:
96
+ require 'jobs'
97
+ end
98
+ end
99
+ ```
89
100
 
90
101
  The scheduler process is just a rake task which is responsible for both
91
102
  queueing items from the schedule and polling the delayed queue for items
@@ -105,7 +116,9 @@ supersedes `VERBOSE`.
105
116
  Delayed jobs are one-off jobs that you want to be put into a queue at some point
106
117
  in the future. The classic example is sending email:
107
118
 
108
- Resque.enqueue_in(5.days, SendFollowUpEmail, :user_id => current_user.id)
119
+ ```ruby
120
+ Resque.enqueue_in(5.days, SendFollowUpEmail, :user_id => current_user.id)
121
+ ```
109
122
 
110
123
  This will store the job for 5 days in the resque delayed queue at which time
111
124
  the scheduler process will pull it from the delayed queue and put it in the
@@ -136,10 +149,12 @@ disclosure is always best.
136
149
 
137
150
  If you have the need to cancel a delayed job, you can do like so:
138
151
 
139
- # after you've enqueued a job like:
140
- Resque.enqueue_at(5.days.from_now, SendFollowUpEmail, :user_id => current_user.id)
141
- # remove the job with exactly the same parameters:
142
- Resque.remove_delayed(SendFollowUpEmail, :user_id => current_user.id)
152
+ ```ruby
153
+ # after you've enqueued a job like:
154
+ Resque.enqueue_at(5.days.from_now, SendFollowUpEmail, :user_id => current_user.id)
155
+ # remove the job with exactly the same parameters:
156
+ Resque.remove_delayed(SendFollowUpEmail, :user_id => current_user.id)
157
+ ```
143
158
 
144
159
  ### Scheduled Jobs (Recurring Jobs)
145
160
 
@@ -151,26 +166,28 @@ The schedule is a list of Resque worker classes with arguments and a
151
166
  schedule frequency (in crontab syntax). The schedule is just a hash, but
152
167
  is most likely stored in a YAML like so:
153
168
 
154
- CancelAbandonedOrders:
155
- cron: "*/5 * * * *"
156
-
157
- queue_documents_for_indexing:
158
- cron: "0 0 * * *"
159
- # you can use rufus-scheduler "every" syntax in place of cron if you prefer
160
- # every: 1hr
161
- # By default the job name (hash key) will be taken as worker class name.
162
- # If you want to have a different job name and class name, provide the 'class' option
163
- class: QueueDocuments
164
- queue: high
165
- args:
166
- description: "This job queues all content for indexing in solr"
167
-
168
- clear_leaderboards_contributors:
169
- cron: "30 6 * * 1"
170
- class: ClearLeaderboards
171
- queue: low
172
- args: contributors
173
- description: "This job resets the weekly leaderboard for contributions"
169
+ ```yaml
170
+ CancelAbandonedOrders:
171
+ cron: "*/5 * * * *"
172
+
173
+ queue_documents_for_indexing:
174
+ cron: "0 0 * * *"
175
+ # you can use rufus-scheduler "every" syntax in place of cron if you prefer
176
+ # every: 1hr
177
+ # By default the job name (hash key) will be taken as worker class name.
178
+ # If you want to have a different job name and class name, provide the 'class' option
179
+ class: QueueDocuments
180
+ queue: high
181
+ args:
182
+ description: "This job queues all content for indexing in solr"
183
+
184
+ clear_leaderboards_contributors:
185
+ cron: "30 6 * * 1"
186
+ class: ClearLeaderboards
187
+ queue: low
188
+ args: contributors
189
+ description: "This job resets the weekly leaderboard for contributions"
190
+ ```
174
191
 
175
192
  The queue value is optional, but if left unspecified resque-scheduler will
176
193
  attempt to get the queue from the job class, which means it needs to be
@@ -180,16 +197,19 @@ need to either set the queue in the schedule or require your jobs in your
180
197
 
181
198
  You can provide options to "every" or "cron" via Array:
182
199
 
183
- clear_leaderboards_moderator:
184
- every: ["30s", :first_in => '120s']
185
- class: CheckDaemon
186
- queue: daemons
187
- description: "This job will check Daemon every 30 seconds after 120 seconds after start"
188
-
200
+ ```yaml
201
+ clear_leaderboards_moderator:
202
+ every:
203
+ - "30s"
204
+ - :first_in: "120s"
205
+ class: CheckDaemon
206
+ queue: daemons
207
+ description: "This job will check Daemon every 30 seconds after 120 seconds after start"
208
+ ```
189
209
 
190
210
  NOTE: Six parameter cron's are also supported (as they supported by
191
211
  rufus-scheduler which powers the resque-scheduler process). This allows you
192
- to schedule jobs per second (ie: "30 * * * * *" would fire a job every 30
212
+ to schedule jobs per second (ie: `"30 * * * * *"` would fire a job every 30
193
213
  seconds past the minute).
194
214
 
195
215
  A big shout out to [rufus-scheduler](http://github.com/jmettraux/rufus-scheduler)
@@ -203,13 +223,17 @@ rather than the `config.time_zone` specified in Rails.
203
223
 
204
224
  You can explicitly specify the time zone that rufus-scheduler will use:
205
225
 
206
- cron: "30 6 * * 1 Europe/Stockholm"
226
+ ```yaml
227
+ cron: "30 6 * * 1 Europe/Stockholm"
228
+ ```
207
229
 
208
230
  Also note that `config.time_zone` in Rails allows for a shorthand (e.g. "Stockholm")
209
231
  that rufus-scheduler does not accept. If you write code to set the scheduler time zone
210
232
  from the `config.time_zone` value, make sure it's the right format, e.g. with:
211
233
 
212
- ActiveSupport::TimeZone.find_tzinfo(Rails.configuration.time_zone).name
234
+ ```ruby
235
+ ActiveSupport::TimeZone.find_tzinfo(Rails.configuration.time_zone).name
236
+ ```
213
237
 
214
238
  A future version of resque-scheduler may do this for you.
215
239
 
@@ -238,42 +262,48 @@ trying to support all existing and future custom job classes, instead it
238
262
  supports a schedule flag so you can extend your custom class and make it
239
263
  support scheduled job.
240
264
 
241
- Let's pretend we have a JobWithStatus class called FakeLeaderboard
265
+ Let's pretend we have a `JobWithStatus` class called `FakeLeaderboard`
242
266
 
243
- class FakeLeaderboard < Resque::JobWithStatus
244
- def perform
245
- # do something and keep track of the status
246
- end
247
- end
267
+ ```ruby
268
+ class FakeLeaderboard < Resque::JobWithStatus
269
+ def perform
270
+ # do something and keep track of the status
271
+ end
272
+ end
273
+ ```
248
274
 
249
275
  And then a schedule:
250
276
 
251
- create_fake_leaderboards:
252
- cron: "30 6 * * 1"
253
- queue: scoring
254
- custom_job_class: FakeLeaderboard
255
- args:
256
- rails_env: demo
257
- description: "This job will auto-create leaderboards for our online demo and the status will update as the worker makes progress"
277
+ ```yaml
278
+ create_fake_leaderboards:
279
+ cron: "30 6 * * 1"
280
+ queue: scoring
281
+ custom_job_class: FakeLeaderboard
282
+ args:
283
+ rails_env: demo
284
+ description: "This job will auto-create leaderboards for our online demo and the status will update as the worker makes progress"
285
+ ```
258
286
 
259
287
  If your extension doesn't support scheduled job, you would need to extend the
260
288
  custom job class to support the #scheduled method:
261
289
 
262
- module Resque
263
- class JobWithStatus
264
- # Wrapper API to forward a Resque::Job creation API call into
265
- # a JobWithStatus call.
266
- def self.scheduled(queue, klass, *args)
267
- create(*args)
268
- end
269
- end
290
+ ```ruby
291
+ module Resque
292
+ class JobWithStatus
293
+ # Wrapper API to forward a Resque::Job creation API call into
294
+ # a JobWithStatus call.
295
+ def self.scheduled(queue, klass, *args)
296
+ create(*args)
270
297
  end
298
+ end
299
+ end
300
+ ```
271
301
 
272
302
  ### Redundancy and Fail-Over
273
303
 
274
304
  *>= 2.0.1 only. Prior to 2.0.1, it is not recommended to run multiple resque-scheduler processes and will result in duplicate jobs.*
275
305
 
276
- You may want to have resque-scheduler running on multiple machines for
306
+ You may want to have resque-scheduler running on multiple machines for
277
307
  redudancy. Electing a master and failover is built in and default. Simply
278
308
  run resque-scheduler on as many machine as you want pointing to the same
279
309
  redis instance and schedule. The scheduler processes will use redis to
@@ -311,14 +341,18 @@ include the `resque-scheduler` plugin and the resque-schedule server extension
311
341
  to the resque-web sinatra app. Unless you're running redis on localhost, you
312
342
  probably already have this file. It probably looks something like this:
313
343
 
314
- require 'resque' # include resque so we can configure it
315
- Resque.redis = "redis_server:6379" # tell Resque where redis lives
344
+ ```ruby
345
+ require 'resque' # include resque so we can configure it
346
+ Resque.redis = "redis_server:6379" # tell Resque where redis lives
347
+ ```
316
348
 
317
349
  Now, you want to add the following:
318
350
 
319
- # This will make the tabs show up.
320
- require 'resque_scheduler'
321
- require 'resque_scheduler/server'
351
+ ```ruby
352
+ # This will make the tabs show up.
353
+ require 'resque_scheduler'
354
+ require 'resque_scheduler/server'
355
+ ```
322
356
 
323
357
  That should make the scheduler tabs show up in `resque-web`.
324
358
 
@@ -330,7 +364,9 @@ process aware of the schedule because it reads it from redis. But prior to
330
364
  2.0, you'll want to make sure you load the schedule in this file as well.
331
365
  Something like this:
332
366
 
333
- Resque.schedule = YAML.load_file(File.join(RAILS_ROOT, 'config/resque_schedule.yml')) # load the schedule
367
+ ```ruby
368
+ Resque.schedule = YAML.load_file(File.join(RAILS_ROOT, 'config/resque_schedule.yml')) # load the schedule
369
+ ```
334
370
 
335
371
  Now make sure you're passing that file to resque-web like so:
336
372
 
@@ -347,6 +383,32 @@ worker is started.
347
383
  $ PIDFILE=./resque-scheduler.pid BACKGROUND=yes \
348
384
  rake resque:scheduler
349
385
 
386
+
387
+ ### Logging
388
+
389
+ There are several options to toggle the way scheduler logs its actions. They
390
+ are toggled by environment variables:
391
+
392
+ - `MUTE` will stop logging anything. Completely silent;
393
+ - `VERBOSE` opposite to 'mute' will log even debug information;
394
+ - `LOGFILE` specifies the file to write logs to. Default is standard output.
395
+
396
+ All those variables are non-mandatory and default values are
397
+
398
+ ```ruby
399
+ Resque::Scheduler.mute = false
400
+ Resque::Scheduler.verbose = false
401
+ Resque::Scheduler.logfile = nil # that means, all messages go to STDOUT
402
+ ```
403
+
404
+
405
+ ### Polling frequency
406
+
407
+ You can pass an INTERVAL option which is a integer representing the polling frequency.
408
+ The default is 5 seconds, but for a semi-active app you may want to use a smaller (integer) value.
409
+
410
+ $ INTERVAL=1 rake resque:scheduler
411
+
350
412
  ### Plagiarism alert
351
413
 
352
414
  This was intended to be an extension to resque and so resulted in a lot of the
@@ -357,6 +419,12 @@ work on resque-scheduler.
357
419
 
358
420
  ### Contributing
359
421
 
360
- For bugs or suggestions, please just open an issue in github.
422
+ See [CONTRIBUTING.md](CONTRIBUTING.md)
423
+
424
+ ### Authors
425
+
426
+ See [AUTHORS.md](AUTHORS.md)
427
+
428
+ ### License
361
429
 
362
- Patches are always welcome.
430
+ See [LICENSE](LICENSE)