feat: remove shutdown message because it doesn't hit
This commit is contained in:
parent
710e3eeb94
commit
6be649f0fc
2 changed files with 0 additions and 41 deletions
21
src/main.rs
21
src/main.rs
|
|
@ -11,22 +11,6 @@ use tracing_appender::rolling::{RollingFileAppender, Rotation};
|
|||
use tracing_subscriber::filter::LevelFilter;
|
||||
use tracing_subscriber::{fmt, layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
struct ShutdownGuard {
|
||||
discord_client: Arc<discord::DiscordClient>,
|
||||
}
|
||||
|
||||
impl Drop for ShutdownGuard {
|
||||
fn drop(&mut self) {
|
||||
info!("Shutdown guard triggered");
|
||||
let runtime = tokio::runtime::Runtime::new().unwrap();
|
||||
runtime.block_on(async {
|
||||
if let Err(e) = self.discord_client.send_shutdown_message().await {
|
||||
error!("Failed to send shutdown message: {}", e);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
info!("creating logs directory");
|
||||
|
|
@ -58,11 +42,6 @@ async fn main() -> Result<()> {
|
|||
let discord_client = discord::DiscordClient::new().await?;
|
||||
let discord_client = Arc::new(discord_client);
|
||||
|
||||
// Create shutdown guard that will send message on any exit
|
||||
let _guard = ShutdownGuard {
|
||||
discord_client: Arc::clone(&discord_client),
|
||||
};
|
||||
|
||||
discord_client.send_startup_message().await?;
|
||||
|
||||
const DEFAULT_GPIO_PIN: u8 = 17;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue