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

Method init_next_task_time

components/scheduler/src/scheduled_task_manager.rs:32–51  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

30 }
31
32 pub async fn init_next_task_time(&mut self) {
33 if self.next_task_time.is_some() {
34 return;
35 }
36
37 // fetch
38 match self
39 .storage
40 .get_next_task_time(self.guild_id, &self.pending, &self.active_task_buckets)
41 .await
42 {
43 Ok(v) => {
44 self.next_task_time = Some(v);
45 }
46 Err(err) => {
47 error!(%err, "failed fetching next task time");
48 self.next_task_time = Some(Some(Utc::now().add(chrono::Duration::seconds(10))));
49 }
50 }
51 }
52
53 pub fn next_action(&mut self) -> NextAction {
54 match self.next_task_time {

Callers 1

next_eventMethod · 0.80

Calls 2

get_next_task_timeMethod · 0.80
addMethod · 0.80

Tested by

no test coverage detected