Skip to content

Commit

Permalink
Allow returning entire run object from App#run, refs #157
Browse files Browse the repository at this point in the history
via option :return_obj => true

Allows accessing e.g. process status ($? is not threadsafe, and a leaky detail of the previous underlying implementation via backticks)
  • Loading branch information
dzuelke committed Jan 24, 2023
1 parent 81c6fde commit 04ae307
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Delay for empty/timeout retries if run_multi is off, defaults to 1 s, global override `$HATCHET_RUN_RETRY_DELAY`
- Record and print dyno id ("run.1234") in event of empty output or timeout retry
- Terminate dyno via API on timeout
- Allow returning of entire run object in App#run (to access process status) using :return_obj => true option

## 7.4.0

Expand Down
2 changes: 1 addition & 1 deletion lib/hatchet/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def run(cmd_type, command = DefaultCommand, options = {}, &block)
timeout: options.fetch(:timeout, (ENV["HATCHET_DEFAULT_RUN_TIMEOUT"] || 60).to_i)
).call

return run_obj.output
return options[:return_obj] ? run_obj : run_obj.output
end

private def allow_run_multi!
Expand Down

0 comments on commit 04ae307

Please sign in to comment.