Skip to content

Commit

Permalink
Send EMS_ID for per_ems_workers
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Apr 29, 2019
1 parent 88c803c commit 225cd1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/models/mixins/per_ems_worker_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,11 @@ def ext_management_system
def worker_options
super.merge(:ems_id => ems_id)
end

def unit_config_file
<<~UNIT_CONFIG_FILE
[Service]
Environment=EMS_ID=#{ems_id}
UNIT_CONFIG_FILE
end
end
2 changes: 2 additions & 0 deletions lib/workers/bin/run_single_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
ENV["DISABLE_MIQ_WORKER_HEARTBEAT"] ||= options[:heartbeat] ? nil : '1'
ENV["BUNDLER_GROUPS"] = MIQ_WORKER_TYPES[worker_class].join(',')

options[:ems_id] ||= ENV["EMS_ID"]

require File.expand_path("../../../config/environment", __dir__)

worker_class = worker_class.constantize
Expand Down

0 comments on commit 225cd1f

Please sign in to comment.