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

Method wait_all_shutdown

components/scheduler/src/scheduler.rs:102–121  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

100 }
101
102 async fn wait_all_shutdown(&mut self) {
103 info!("shutdown pending guilds: {}", self.guilds.len());
104 if self.guilds.is_empty() {
105 return;
106 }
107
108 loop {
109 if let SchedulerAction::GuildHandler(guild_id, None) = self.next_action().await {
110 // worker finished, remove it
111 self.guilds.remove(&guild_id);
112 self.check_queue_start_worker(guild_id).await;
113
114 info!("shutdown pending guilds: {}", self.guilds.len());
115
116 if self.guilds.is_empty() {
117 return;
118 }
119 }
120 }
121 }
122
123 async fn next_action(&mut self) -> SchedulerAction {
124 SchedulerNextActionFuture { scheduler: self }.await

Callers 1

runMethod · 0.80

Calls 3

removeMethod · 0.80
next_actionMethod · 0.45

Tested by

no test coverage detected