Cache SwapResponse, MeltBolt11Response and MintBolt11Response (#361)

* added cache to mint state and post request wrapper macro.
---------

Co-authored-by: thesimplekid <tsk@thesimplekid.com>
This commit is contained in:
lollerfirst
2024-10-05 11:18:23 +02:00
committed by GitHub
parent c0967d8079
commit c25bf79e8c
12 changed files with 149 additions and 24 deletions

View File

@@ -84,10 +84,17 @@ pub async fn start_mint(
supported_units,
)
.await?;
let cache_time_to_live = 3600;
let cache_time_to_idle = 3600;
let mint_arc = Arc::new(mint);
let v1_service = cdk_axum::create_mint_router(Arc::clone(&mint_arc)).await?;
let v1_service = cdk_axum::create_mint_router(
Arc::clone(&mint_arc),
cache_time_to_live,
cache_time_to_idle,
)
.await?;
let mint_service = Router::new()
.merge(v1_service)