MCPcopy Create free account
hub / github.com/Qovery/engine / should_abort

Method should_abort

lib-engine/src/cmd/command.rs:49–66  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

47
48impl CommandKillerTrigger<'_> {
49 pub fn should_abort(&self) -> Option<AbortReason> {
50 match self {
51 CommandKillerTrigger::Timeout(since, timeout) => {
52 if &since.elapsed() >= timeout {
53 Some(AbortReason::Timeout(*timeout))
54 } else {
55 None
56 }
57 }
58 CommandKillerTrigger::Cancelable(func) => {
59 if func.status().should_cancel() {
60 Some(AbortReason::Canceled("Task Canceled".to_string()))
61 } else {
62 None
63 }
64 }
65 }
66 }
67}
68
69pub enum CommandKiller<'a> {

Callers 5

provision_builderMethod · 0.80
await_resolveFunction · 0.80
exec_with_abortMethod · 0.80
build_with_buildkitMethod · 0.80

Calls 3

TimeoutEnum · 0.85
should_cancelMethod · 0.80
statusMethod · 0.80

Tested by

no test coverage detected