Skip to content

Commit b8ff5a3

Browse files
committed
refactor: Sleep 5s before deleting the VM
1 parent b5743b3 commit b8ff5a3

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

  • workflow/deployer-workflow/impl-flyio/src

workflow/deployer-workflow/impl-flyio/src/lib.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ use const_format::formatcp;
66
use generated::{
77
export,
88
exports::obelisk_flyio::workflow::workflow::Guest,
9-
obelisk::{types::time::ScheduleAt, workflow::workflow_support},
9+
obelisk::{
10+
types::time::{Duration as SchedulingDuration, ScheduleAt},
11+
workflow::workflow_support,
12+
},
1013
obelisk_flyio::{
1114
activity_fly_http::{
1215
self,
@@ -106,9 +109,7 @@ fn app_modify_without_cleanup(
106109
if state == MachineState::Started {
107110
break;
108111
}
109-
workflow_support::sleep(ScheduleAt::In(
110-
generated::obelisk::types::time::Duration::Seconds(1),
111-
));
112+
workflow_support::sleep(ScheduleAt::In(SchedulingDuration::Seconds(1)));
112113
}
113114

114115
// Write obelisk.toml
@@ -150,6 +151,9 @@ fn app_modify_without_cleanup(
150151
// Attempt to shutdown the temp VM.
151152
// Ignore failure to shut down, temp VM will be deleted with force.
152153
let _ = activity_fly_http::machines::stop(app_name, &temp_vm);
154+
// Wait a bit for clean shutdown
155+
workflow_support::sleep(ScheduleAt::In(SchedulingDuration::Seconds(5)));
156+
// Destroy the VM with force.
153157
activity_fly_http::machines::delete(app_name, &temp_vm, true)
154158
.map_err(AppInitModifyError::TempVmError)?;
155159

0 commit comments

Comments
 (0)