From 1008c107cde5b5c94c4c4e90ad94d099c4daabda Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Fri, 26 Jul 2024 15:30:34 +0200 Subject: [PATCH] Fix docs for cache ttl env var --- README.md | 2 +- bun.lockb | Bin 135564 -> 135564 bytes src/server.tsx | 8 ++++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 350ba4c..b8b0fb8 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ Here are the available configuration options: | `settings.feeMultiplier` | The multiplier to apply to the fee estimates | `1` | `FEE_MULTIPLIER` | | `settings.feeMinimum` | The minimum fee (sat/vB) to use for fee estimates if we could not determine from a configured data source | `2` | `FEE_MINIMUM` | | `settings.maxHeightDelta` | The maximum acceptable difference between the block heights of the most current fee estimates. | `3` | `MAX_HEIGHT_DELTA` | -| `cache.stdTTL` | The standard time to live in seconds for every generated cache element | `15` | `CACHE_STDTTL` | +| `cache.stdTTL` | The standard time to live in seconds for every generated cache element | `15` | `CACHE_STD_TTL` | | `cache.checkperiod` | The period in seconds, used for the automatic delete check interval | `20` | `CACHE_CHECKPERIOD` | ### Mempool settings diff --git a/bun.lockb b/bun.lockb index 0eb7aea0495d183bbb578fa62b50272edfa08024..a760b9d9835483cb4fd61b5a8a68c9824b74c158 100755 GIT binary patch delta 2100 zcmW;AH;|_U07mh-8Hc%wlItib87oT4e@V%8l$4AWCB>?kRt&3{F|4AVif6)%88c?g zm@#8K^sZp^d(Cg&y#2$Y`-ewQp4vNd*P40cZp7cGy3~FB`&zTRHwofgF>gq4a3WH8Z<6fN7$ly zg-(neT36~M*rR=*lj4BRRXQ1t=w7Xp>x|f<4-I>!diKb3!M>5#4)qa-7h+SEs-k{rhxETyWRu zRJdYrzfO%Ch9`9zG#*e#*rNHMPK+H|59uV>qy4Z>iUT^2=wvve+v?;vq4%gxfiwD# z>6EzO?s1(8R}7xesd2;bNu36br_>R)Xg;kIV~19!lVFebGdd{_=sc^F;fU^YIyp}0 zJ+D*XjQ$HcB`&yoQK!NcgO_w_+%W8Q8Z=&3N7$nIicX9jTCeIP*rWZLPKpCMuj^zu zqWgwUjuU!s>J&JmKj@UW;O;G*3Reu?)~RvB@Ex57jd#@%wrIYm6Jv+g`#K5sXn&xS z;(*Smli`T&hdMb<=zXM9;EevqIwdZ+`$VV06@yQ8YTPjVOs7HPb9IC*nv+h99a>-L zB-o?Xl zs1sv{)=xSK_GtgClj4BRFFF~H=>DpcEj1yTgML0vCi5%)1Eo9 Gf9yZ4>-jSP delta 2100 zcmW;AH;|_U07h|d#$m3aX3Ur| zW5#&sUBT%0n%}&6`-eyO509QWxp(A@gLUut{|4vC8aE8j)oIW;PaR>4X08)sht~Nz z3HE4Tpp)W&&V@P|j_6*bljDTm#X1Gf=SQ>gdzDU(6MCgifiwD7>y)_Q?i!s6R}8Mzsd2;bI-LfM z>(vpqXx^X`V~5s_Itlh@S2`&U=-i}};fU_dIyp}0-J(XFp%Y_=)}1;D_GsUwlj4BR-8vbL=-#7~NIFPrH-&g^J$$JJG45T1beif(MfSY=UJT$M|7Xl$#FvO zd7T1h^k2{^alze-Iu))Myrfg(hGDPMpz*Rg!WPX}bYkq#dQ~UE9_`n3QXJ5ET_?j4 z-8Xb{oX~qyr@$HgL8rt8cW>!bxMJ|OPK_Ie@8~pWysM6|Me{wK7(2Ay*GaHP`vaX6 z2XscA3`cZ7)X8x|?<1W8XY@bTDRIHwCps0b7<{TzNBd`;6bE#E(aCT`_g9@9C-fGb0%!Dp(`mb_Vkhc GWB&mg$oJX+ diff --git a/src/server.tsx b/src/server.tsx index 8e022a2..d9753d6 100644 --- a/src/server.tsx +++ b/src/server.tsx @@ -36,7 +36,7 @@ const TIMEOUT = config.get("settings.timeout"); const FEE_MULTIPLIER = config.get("settings.feeMultiplier"); const FEE_MINIMUM = config.get("settings.feeMinimum"); const MAX_HEIGHT_DELTA = config.get("settings.maxHeightDelta"); -const CACHE_STDTTL = config.get("cache.stdTTL"); +const CACHE_STD_TTL = config.get("cache.stdTTL"); const CACHE_CHECKPERIOD = config.get("cache.checkperiod"); const log = logger(LOGLEVEL, "server"); @@ -51,7 +51,7 @@ log.info(config.util.toObject()); // Register data provider service. const service = new DataProviderManager( { - stdTTL: CACHE_STDTTL, + stdTTL: CACHE_STD_TTL, checkperiod: CACHE_CHECKPERIOD, }, MAX_HEIGHT_DELTA, @@ -125,7 +125,7 @@ app.get("/", async (c) => { try { data = await service.getData(); // Set cache headers. - c.res.headers.set("Cache-Control", `public, max-age=${CACHE_STDTTL}`); + c.res.headers.set("Cache-Control", `public, max-age=${CACHE_STD_TTL}`); } catch (error) { log.error(error); data = { @@ -158,7 +158,7 @@ app.get("/v1/fee-estimates", async (c) => { data = await service.getData(); // Set cache headers. - c.res.headers.set("Cache-Control", `public, max-age=${CACHE_STDTTL}`); + c.res.headers.set("Cache-Control", `public, max-age=${CACHE_STD_TTL}`); // Return the estimates. return c.json(data);