Skip to content

Commit

Permalink
new syntax to specify worker queues
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroaxl committed May 23, 2014
1 parent efdb557 commit 5e13f9e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 26 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ opsworks-resque::stop
It expects an array with the queues of workers to run, for example
```ruby
default['resque']['path'] = "/srv/www/mailee_staging/current"
default['resque']['workers'] = ['*', '*', '*'] # 3 workers with queue *
default['resque']['workers'] = ['imports', 'cache'] # 2 workers with queues imports and cache
default['resque']['rails_env'] = "preproduction"
default['resque']['workers'] = {"*" => 2, "images" => 1} # 2 workers for queue * and 1 worker for queue images
default['resque']['rails_env'] = "production"

```

Expand Down
14 changes: 9 additions & 5 deletions recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
mode "0755"
end

node['resque']['workers'].each_with_index do |queue, index|
template "/etc/init/resque-#{index}.conf" do
source "resque-n.conf.erb"
mode "0755"
variables queue: queue, instance: index
i = 1
node['resque']['workers'].each do |queue, quantity|
quantity.times.do
template "/etc/init/resque-#{i}.conf" do
source "resque-n.conf.erb"
mode "0755"
variables queue: queue, instance: i
end
i+=1
end
end
18 changes: 0 additions & 18 deletions templates/default/resque-web.conf.erb

This file was deleted.

0 comments on commit 5e13f9e

Please sign in to comment.