From 4e21655346e438b74349c0911cfa261e06b82ee9 Mon Sep 17 00:00:00 2001 From: Jokler Date: Sat, 14 Mar 2020 18:41:27 +0100 Subject: Fix shutdown freezing the bot This is kind of a work around by ignoring other futures spawned on the tokio runtime but it should not cause any actual issues since the important futures should still block the runtime. --- src/teamspeak/mod.rs | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/teamspeak/mod.rs') diff --git a/src/teamspeak/mod.rs b/src/teamspeak/mod.rs index 7551e77..4d31f2e 100644 --- a/src/teamspeak/mod.rs +++ b/src/teamspeak/mod.rs @@ -1,5 +1,4 @@ use std::sync::{Arc, RwLock}; -use std::time::{Duration, Instant}; use futures::compat::Future01CompatExt; use futures01::{future::Future, sink::Sink}; @@ -224,9 +223,5 @@ impl TeamSpeakConnection { .disconnect(opt) .map_err(|e| error!("Failed to send message: {}", e)), ); - // Might or might not be required to keep tokio running while the bot disconnects - tokio::spawn( - tokio::timer::Delay::new(Instant::now() + Duration::from_secs(1)).map_err(|_| ()), - ); } } -- cgit v1.2.3-70-g09d2