Skip to content

Commit ecdf391

Browse files
author
Cameron Johnston
committed
COOK-2611 Adding queues parameter to celery LWRP
Bind celery listeners to particular queues by providing an array of queue names to the 'queues' parameter. Defaults to ['celery']. This change modifies the provider to use the -Q flag with the list of queues from this parameter at every invocation. Celery documentation states that 'celery' is the default queue name, so this ought not to modify behavior for those currently using this LWRP.
1 parent 14141b7 commit ecdf391

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

providers/celery.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
end
6262

6363
cmds = {}
64-
cmds[:celeryd] = "celeryd #{new_resource.celerycam ? "-E" : ""}" if new_resource.celeryd
64+
cmds[:celeryd] = "celeryd -Q #{new_resource.queues.join(',')} #{new_resource.celerycam ? "-E" : ""}" if new_resource.celeryd
6565
cmds[:celerybeat] = "celerybeat" if new_resource.celerybeat
6666
if new_resource.celerycam
6767
if new_resource.django

resources/celery.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
attribute :celerycam, :kind_of => [TrueClass, FalseClass], :default => false
2929
attribute :camera_class, :kind_of => [String, NilClass], :default => nil
3030
attribute :environment, :kind_of => [Hash], :default => {}
31+
attribute :queues, :kind_of => [Array], :default => ['celery']
3132

3233
def config_base
3334
config.split(/[\\\/]/).last

0 commit comments

Comments
 (0)