File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -175,21 +175,21 @@ Resque workers respond to a few different signals:
175
175
176
176
## Configuration
177
177
178
- You can configure Resque via a ` .resque ` file in the root of your project:
178
+ You can configure Resque via a YAML ` .resque ` file in the root of your project:
179
179
180
180
```
181
- -- queues= high,med,low
182
- -- require= 'some_context.rb'
183
- -- pid_file= 'tmp/pids/resque.pid'
184
- -- interval= 1
185
- -- daemon= true
186
- -- timeout= 5
187
- -- graceful_term= false
181
+ queues: ' high,med,low'
182
+ require: 'some_context.rb'
183
+ pid_file: 'tmp/pids/resque.pid'
184
+ interval: 1
185
+ daemon: true
186
+ timeout: 5
187
+ graceful_term: false
188
188
```
189
189
190
- These act just like you passed them in to ` bin/resque work ` .
190
+ Then pass the configuration to the resque CLI: ` bin/resque work -c='./.resque' ` .
191
191
192
- You can also configure Resque via ` .configure ` :
192
+ You can also configure Resque via ` Resque .configure` :
193
193
194
194
``` ruby
195
195
Resque .configure do |config |
Original file line number Diff line number Diff line change @@ -8,11 +8,12 @@ class CLI < Thor
8
8
class_option :config , :aliases => [ "-c" ] , :type => :string
9
9
class_option :redis , :aliases => [ "-R" ] , :type => :string
10
10
11
- def initialize ( args = [ ] , opts = [ ] , config = { } )
11
+ def initialize ( args = [ ] , opts = { } , config = { } )
12
12
super ( args , opts , config )
13
13
14
14
if options [ :config ] && File . exists? ( options [ :config ] )
15
- @options = YAML . load_file ( options [ :config ] ) . symbolize_keys . merge ( @options . symbolize_keys )
15
+ config_options = YAML . load_file ( options [ :config ] ) . symbolize_keys
16
+ @options = @options . symbolize_keys . merge ( config_options )
16
17
end
17
18
18
19
Resque . redis = options [ :redis ] || "localhost:6379/resque"
You can’t perform that action at this time.
0 commit comments