Skip to content

Commit

Permalink
Merge pull request #60 from LN-Zap/fix/cache-docs
Browse files Browse the repository at this point in the history
Fix docs for cache ttl env var
  • Loading branch information
mrfelton authored Jul 26, 2024
2 parents 229429e + 1008c10 commit f767a7e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file modified bun.lockb
Binary file not shown.
8 changes: 4 additions & 4 deletions src/server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const TIMEOUT = config.get<number>("settings.timeout");
const FEE_MULTIPLIER = config.get<number>("settings.feeMultiplier");
const FEE_MINIMUM = config.get<number>("settings.feeMinimum");
const MAX_HEIGHT_DELTA = config.get<number>("settings.maxHeightDelta");
const CACHE_STDTTL = config.get<number>("cache.stdTTL");
const CACHE_STD_TTL = config.get<number>("cache.stdTTL");
const CACHE_CHECKPERIOD = config.get<number>("cache.checkperiod");

const log = logger(LOGLEVEL, "server");
Expand All @@ -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,
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f767a7e

Please sign in to comment.