Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
anyaelena committed Jun 3, 2019
1 parent f97afe8 commit 23160bd
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions server/app/jobs/dj_jobs/run_simulate_data_point.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,22 @@ def perform
cmd = "#{Utility::Oss.oscli_cmd(@sim_logger)} --verbose run --workflow '#{osw_path}' --debug"
process_log = File.join(simulation_dir, 'oscli_simulation.log')
@sim_logger.info "Running workflow using cmd #{cmd} and writing log to #{process_log}"

pid = Process.spawn({ 'BUNDLE_GEMFILE' => nil, 'BUNDLE_PATH' => nil }, cmd, [:err, :out] => [process_log, 'w'])
oscli_env_unset = {
'BUNDLE_GEMFILE' => nil,
'BUNDLE_PATH' => nil,
'RUBYLIB' => nil,
'RUBYOPT' => nil,
'BUNDLE_BIN_PATH' => nil,
'BUNDLER_VERSION' => nil,
'BUNDLER_ORIG_PATH' => nil,
'BUNDLER_ORIG_MANPATH' => nil,
'GEM_PATH' => nil,
'GEM_HOME' => nil,
'BUNDLE_GEMFILE' => nil,
'BUNDLE_PATH' => nil,
'BUNDLE_WITHOUT' => nil
}
pid = Process.spawn(oscli_env_unset, cmd, [:err, :out] => [process_log, 'w'])

# timeout the process if it doesn't return in 4 hours
Timeout.timeout(14400) do
Expand Down

0 comments on commit 23160bd

Please sign in to comment.