From 904513b71a3c394091354003b40164f73840dbfc Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Fri, 12 Jan 2024 08:47:19 +1100 Subject: [PATCH] log key refresh better --- src/api_interface.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api_interface.rs b/src/api_interface.rs index ce301a3..e47fbc1 100644 --- a/src/api_interface.rs +++ b/src/api_interface.rs @@ -195,11 +195,15 @@ impl TeslaInterface { async fn refresh_keys(&mut self) { // refresh our Tesla (the company's web servers, not the car) access token if Instant::now().duration_since(self.last_refresh) >= KEY_REFRESH_INTERVAL { + log::warn!("refreshing keys..."); match self.api.refresh().await { Ok(_) => { let now = Instant::now(); match self.save_key() { - Ok(_) => self.last_refresh = now, + Ok(_) => { + log::warn!("refreshed keys..."); + self.last_refresh = now; + } Err(e) => error!("error saving auth token: {e:?}"), } }