Skip to content

Commit 99732e5

Browse files
committed
Merge pull request poise#36 from poise/scopefix
Scope fix for restart_command
2 parents 8bdc494 + 470f4cc commit 99732e5

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

providers/celery.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
raise "You must specify an application module to load" unless new_resource.config
2828

2929
if !new_resource.restart_command
30+
r = new_resource
3031
new_resource.restart_command do
31-
run_context.resource_collection.find(:supervisor_service => "#{new_resource.application.name}-celeryd").run_action(:restart) if new_resource.celeryd
32-
run_context.resource_collection.find(:supervisor_service => "#{new_resource.application.name}-celerybeat").run_action(:restart) if new_resource.celerybeat
33-
run_context.resource_collection.find(:supervisor_service => "#{new_resource.application.name}-celerycam").run_action(:restart) if new_resource.celerycam
32+
run_context.resource_collection.find(:supervisor_service => "#{r.application.name}-celeryd").run_action(:restart) if r.celeryd
33+
run_context.resource_collection.find(:supervisor_service => "#{r.application.name}-celerybeat").run_action(:restart) if r.celerybeat
34+
run_context.resource_collection.find(:supervisor_service => "#{r.application.name}-celerycam").run_action(:restart) if r.celerycam
3435
end
3536
end
3637

providers/gunicorn.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434
end
3535

3636
if !new_resource.restart_command
37+
r = new_resource
3738
new_resource.restart_command do
38-
run_context.resource_collection.find(:supervisor_service => new_resource.application.name).run_action(:restart)
39+
run_context.resource_collection.find(:supervisor_service => r.application.name).run_action(:restart)
3940
end
4041
end
4142

0 commit comments

Comments
 (0)