This repository was archived by the owner on Jan 29, 2022. It is now read-only.
Merged
Conversation
bastelfreak
reviewed
Apr 24, 2018
lib/routes/module.rb
Outdated
| module_name = sanitize_input(module_name) | ||
| LOGGER.info("Deploying module #{module_name}") | ||
| deploy_module(module_name) | ||
| Prcocess.detach(fork { deploy_module(module_name) }) |
ekohl
reviewed
Apr 24, 2018
lib/helpers/tasks.rb
Outdated
| message = "forked: #{command}" | ||
| exec "#{command} &" | ||
| exit_status = 0 | ||
| raise "#{stdout}\n#{stderr}" if exit_status != 0 |
Member
There was a problem hiding this comment.
Isn't this line redundant if you explicitly set exit_status = 0?
Member
Author
There was a problem hiding this comment.
@ekohl Would it be better to remove that or replace exit_status = 0 with exit_status = exec "echo $?
Member
There was a problem hiding this comment.
I'd remove it because it's forked and the output is useless:
ekohl@wisse ~ $ false &
[1] 13302
[1]+ Exit 1 false
ekohl@wisse ~ $ echo $?
0
ekohl@wisse ~ $ /usr/bin/sfdsdfsfs &
[1] 13324
bash: /usr/bin/sfdsdfsfs: No such file or directory
[1]+ Exit 127 /usr/bin/sfdsdfsfs
ekohl@wisse ~ $ echo $?
0
78c66a4 to
9cdf3d7
Compare
9cdf3d7 to
108e404
Compare
binford2k
approved these changes
Apr 24, 2018
bastelfreak
approved these changes
Apr 24, 2018
Member
|
Is this why two instances of r10k can now run simultaneously? (which is bad). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removed open3 calls in the
run_commandmethod as it was preventing the application from forking system calls. The logging of commands still exists within the application.Moved the process fork from the
run_commandmethod into the method call in each POST route. This allows for not only running system calls asynchronously, but also allows for the API calls to run asynchronously.This solves an issue where Gitlab and Github webhooks expect a response within 10 seconds while an
r10kormcorun could take longer to return.