adambezecny
adambezecny
we are actually going to use it without parameters, see bellow: ```rust async fn get_new_token() -> Result { let req_body = format!( r#" {{ "strategy": "local", "email": "{email}", "password": "{password}"...
Thank you James for your quick support! I will implement workaround for now and looking forward updated macro. cheers, Adam
I did actually compile like this: ```rust lazy_static! { static ref CACHE: Arc = Arc::new(RwLock::new(Vec::with_capacity(1))); } fn time_now() -> u128 { std::time::SystemTime::now() .duration_since(std::time::UNIX_EPOCH) .unwrap() .as_millis() } async fn get_token() ->...
hi, any progress on this issue? Is it possible to implement this RwLock based cache as discussed?
hi James, so to cache token for 23 hours I should use: ``` #[once(size = 1, time = 82800, result = true, sync_writes = true)] pub async fn get_token() ->...
ok, got it. so **sync_writes = true** basically does same above discussed section in manual code: ``` let already_set = store .get(0) .map(|(created_ts, _)| (time_now() - created_ts) < 82800) .unwrap_or(false);...
hi James, with following dependencies: ```rust [dependencies] tokio = { version = "1.7.1", default-features = false, features = ["macros", "time", "rt-multi-thread", "signal", "fs", "rt"] } cached = "0.26.0" [dev-dependencies] criterion...
I am having exactly same issue ``` OS: Mac OS Ventura 13.0.1 uname -a Darwin Adams-MBP 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct 9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000 arm64 rustc...
I found the reason why it is not working, following must be added: ``` .set("auto.offset.reset", "earliest") ``` Actually it is in the sample, it is just commented. Maybe it would...