chore: remove dummy service

This commit is contained in:
2025-08-26 19:16:11 -05:00
parent 87100a57d5
commit 5018ad0d31
3 changed files with 10 additions and 48 deletions

View File

@@ -1,42 +0,0 @@
use super::Service;
use std::time::Duration;
use tracing::{error, info};
/// Dummy service implementation for demonstration
pub struct DummyService {
name: &'static str,
}
impl DummyService {
pub fn new(name: &'static str) -> Self {
Self { name }
}
}
#[async_trait::async_trait]
impl Service for DummyService {
fn name(&self) -> &'static str {
self.name
}
async fn run(&mut self) -> Result<(), anyhow::Error> {
let mut counter = 0;
loop {
tokio::time::sleep(Duration::from_secs(10)).await;
counter += 1;
info!(service = self.name, "Service heartbeat ({counter})");
// Simulate service failure after 60 seconds for demo
if counter >= 6 {
error!(service = self.name, "Service encountered an error");
return Err(anyhow::anyhow!("Service error"));
}
}
}
async fn shutdown(&mut self) -> Result<(), anyhow::Error> {
// Simulate cleanup work
tokio::time::sleep(Duration::from_millis(6000)).await;
Ok(())
}
}

View File

@@ -2,7 +2,6 @@ use tokio::sync::broadcast;
use tracing::{error, info, warn};
pub mod bot;
pub mod dummy;
pub mod manager;
#[derive(Debug)]