Open
Description
Here is my fn
#[cached(result = true, time = 0, size = 500, sync_writes = true)]
pub async fn token_info_cache(addr: String) -> ApiResult<(Json<TokenInfoResponse>, String)> {
let msg = cw20_base::msg::QueryMsg::TokenInfo {};
info!(" >> Fetching token_info for {}", addr);
let string = refresh(addr, msg).await?;
let value: TokenInfoResponse = serde_json::from_str(&string)?;
Ok((Json::from(value), string))
}
calling concurrently with different values is causing the fn to execute sequentially which is not desired. Ex.
let (a, b) = join!(
token_info_cache("a".to_string()),
token_info_cache("b".to_string()),
)
This will run sequentially and not concurrently. Removing sync_writes = true
fixes the issue and it runs concurrently but obviously doesn't sync writes when the argument is the same. This is using v0.44.0
Metadata
Metadata
Assignees
Labels
No labels