Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docs for cache ttl env var #60

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading