add ability to start workers synchronously
This commit is contained in:
parent
e682e75884
commit
c5264401ee
@ -34,6 +34,14 @@ class Worker
|
||||
uri.to_s
|
||||
end
|
||||
|
||||
def self.start_sync(worker_class, request, job_options)
|
||||
stringified_options = {}
|
||||
job_options.each do |key, value|
|
||||
stringified_options[key.to_s] = value
|
||||
end
|
||||
worker_class.new.perform(stringified_options)
|
||||
end
|
||||
|
||||
def self.set_status id, status
|
||||
Sidekiq.redis {|con| con.hset "devops", id, status}
|
||||
end
|
||||
@ -86,7 +94,7 @@ class Worker
|
||||
end
|
||||
|
||||
# outputs to STDOUT
|
||||
def call_sync
|
||||
def call_sync(provider)
|
||||
out = STDOUT
|
||||
begin
|
||||
yield(provider, out, '')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user