From e2a4e9cf13c939e8b158c58cbc5c4f8af8e994e3 Mon Sep 17 00:00:00 2001 From: Conrad Ludgate Date: Mon, 1 Jan 2024 16:42:36 +0000 Subject: fix(stats): time now_local not working --- atuin-client/src/settings.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'atuin-client') diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs index 93bc64ea..7e251550 100644 --- a/atuin-client/src/settings.rs +++ b/atuin-client/src/settings.rs @@ -219,7 +219,13 @@ pub struct Settings { // This is automatically loaded when settings is created. Do not set in // config! Keep secrets and settings apart. + #[serde(skip)] pub session_token: String, + + // This is determined at startup and cached. + // This is due to non-threadsafe get-env limitations. + #[serde(skip)] + pub local_tz: Option, } impl Settings { @@ -488,6 +494,8 @@ impl Settings { settings.session_token = String::from("not logged in"); } + settings.local_tz = time::UtcOffset::current_local_offset().ok(); + Ok(settings) } -- cgit v1.3.1