This commit is contained in:
Alex Janka 2024-01-23 12:16:04 +11:00
parent 2ed83084a7
commit 48b91c5e19
2 changed files with 4 additions and 5 deletions

View file

@ -47,7 +47,6 @@ impl ConfigWatcher {
let config_path = PathBuf::from(path);
let handle = tokio::task::spawn(async move {
log::warn!("from task");
loop {
match rx.recv().await {
Some(Ok(_event)) => {

View file

@ -51,10 +51,6 @@ async fn main() {
.init();
let args = Args::parse();
let auth_path = args.config_dir.join("auth");
let config_path = args.config_dir.join("config.json");
let (config, _config_watcher) = config::init_config(config_path);
config::CONFIG.get_or_init(|| RwLock::new(config));
let _recorder = metrics_prometheus::install();
match args.command {
@ -65,6 +61,10 @@ async fn main() {
);
}
Commands::Watch => {
let auth_path = args.config_dir.join("auth");
let config_path = args.config_dir.join("config.json");
let (config, _config_watcher) = config::init_config(config_path);
config::CONFIG.get_or_init(|| RwLock::new(config));
if let Some(mut interface) = TeslaInterface::load(auth_path)
.await
.some_or_print_with("loading tesla interface")