MCPcopy Create free account
hub / github.com/Botloader/botloader / stop_vm

Method stop_vm

components/vm/src/vm.rs:480–494  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

478
479 #[instrument(skip(self))]
480 async fn stop_vm(&mut self) {
481 if tokio::time::timeout(
482 tokio::time::Duration::from_secs(15),
483 self.run_until_completion(),
484 )
485 .await
486 .is_err()
487 {
488 self.guild_logger.log(CreateLogEntry::error(
489 "shutting down your vm timed out after 15 sec, cancelling all pending promises \
490 and force-shutting down now instead..."
491 .to_string(),
492 ));
493 }
494 }
495
496 async fn run_until_completion(&mut self) {
497 loop {

Callers 2

runMethod · 0.80
restartMethod · 0.80

Calls 3

errorFunction · 0.85
run_until_completionMethod · 0.80
logMethod · 0.80

Tested by

no test coverage detected