refactor(config)!: Move scheduler out of device_manager
Due to changes made in mlua the new scheduler is much simpler. It also had no real business being part of the device manager, so it has now been moved to be part of the returned config.
This commit is contained in:
@@ -6,6 +6,7 @@ use std::process;
|
||||
|
||||
use ::config::{Environment, File};
|
||||
use automation::config::{Config, Setup};
|
||||
use automation::schedule::start_scheduler;
|
||||
use automation::secret::EnvironmentSecretFile;
|
||||
use automation::version::VERSION;
|
||||
use automation::web::{ApiError, User};
|
||||
@@ -142,6 +143,8 @@ async fn app() -> anyhow::Result<()> {
|
||||
device_manager.add(device).await;
|
||||
}
|
||||
|
||||
start_scheduler(config.schedule).await?;
|
||||
|
||||
// Create google home fulfillment route
|
||||
let fulfillment = Router::new().route("/google_home", post(fulfillment));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user