Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main: Fix timeout handler #579

Merged
merged 1 commit into from
Nov 9, 2021
Merged

Conversation

monstermunchkin
Copy link
Member

This moves the timeout handler to PersistentPreRun which makes the
value of the --timeout flag available. Previously, the timeout handler
was broken as it was run before the value was set by cobra.

Signed-off-by: Thomas Hipp thomas.hipp@canonical.com

This moves the timeout handler to PersistentPreRun which makes the
value of the `--timeout` flag available. Previously, the timeout handler
was broken as it was run before the value was set by cobra.

Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Copy link
Contributor

@tomponline tomponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of interest, is there any reason why the timeout isn't implemented as a context so that if the timeout elapses the error returned to the user would give an indication what the program was doing when it timed out?

@monstermunchkin
Copy link
Member Author

Out of interest, is there any reason why the timeout isn't implemented as a context so that if the timeout elapses the error returned to the user would give an indication what the program was doing when it timed out?

Nope, there's no specific reason for not using context. We could implement it though.

@stgraber stgraber merged commit 76379b9 into lxc:master Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants