diff --git a/src/service/admin/startup.rs b/src/service/admin/startup.rs index 79dc70d0..8a4a3d63 100644 --- a/src/service/admin/startup.rs +++ b/src/service/admin/startup.rs @@ -1,7 +1,4 @@ - -use conduit::{ - debug, error, implement, info, -}; +use conduit::{debug, debug_info, error, implement, info}; use ruma::events::room::message::RoomMessageEventContent; use tokio::time::{sleep, Duration}; @@ -33,6 +30,16 @@ pub(super) async fn startup_execute(&self) { self.startup_execute_command(i, command.clone()).await; tokio::task::yield_now().await; } + + // The smoketest functionality is placed here for now and simply initiates + // shutdown after all commands have executed. + if self.services.server.config.test.contains("smoke") { + debug_info!("Smoketest mode. All commands complete. Shutting down now..."); + self.services + .server + .shutdown() + .unwrap_or_else(error::default_log); + } } /// Execute one admin command after startup