Skip to content

Commit

Permalink
Dynamically send clone notification to listener queues
Browse files Browse the repository at this point in the history
  • Loading branch information
soumyaray committed Dec 29, 2017
1 parent e54fb6f commit a62b538
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions application/services/summarize_folder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def clone_repo(input)
# TODO:
# - send message to worker using notify_clone_listeners?
# - send repo to worker and let it find gitrepo
CloneRepoWorker.perform_async(clone_request_msg)
# CloneRepoWorker.perform_async(clone_request_msg)
notify_clone_listeners(clone_request_msg)
Left(Result.new(:processing, { id: input[:id] }))
end
Expand All @@ -50,8 +50,11 @@ def clone_request_json(input)
end

def notify_clone_listeners(message)
report_queue = Messaging::Queue.new(app.config.REPORT_QUEUE_URL)
report_queue.send(message)
app.config.CLONE_LISTENERS.split.each do |queue_name|
queue_url = app.config.send(queue_name)
report_queue = Messaging::Queue.new(queue_url)
report_queue.send(message)
end
end
end
end

0 comments on commit a62b538

Please sign in to comment.