@effectstream/utils 0.100.22 → 0.100.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/config.ts +20 -0
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -314,6 +314,20 @@ const definitions: Record<string, ConfigDefinition> = {
|
|
|
314
314
|
description:
|
|
315
315
|
"Snapshot retention: keep one snapshot per day for this many days. Snapshots older than this are deleted. Default: 7.",
|
|
316
316
|
},
|
|
317
|
+
EFFECTSTREAM_COALESCE_EMPTY_BLOCKS: {
|
|
318
|
+
key: "EFFECTSTREAM_COALESCE_EMPTY_BLOCKS",
|
|
319
|
+
type: "boolean",
|
|
320
|
+
defaultValue: false,
|
|
321
|
+
description:
|
|
322
|
+
"Fold consecutive empty catch-up blocks into one DB transaction when behind the chain tip. Default: false.",
|
|
323
|
+
},
|
|
324
|
+
EFFECTSTREAM_FINALIZED_STREAM_CAP: {
|
|
325
|
+
key: "EFFECTSTREAM_FINALIZED_STREAM_CAP",
|
|
326
|
+
type: "number",
|
|
327
|
+
defaultValue: 2048,
|
|
328
|
+
description:
|
|
329
|
+
"Backpressure cap on the in-memory finalized-block queue between the merge and the runtime apply loop. The merge blocks once this many produced blocks are unconsumed, bounding memory during deep catch-up. Default: 2048.",
|
|
330
|
+
},
|
|
317
331
|
} as const;
|
|
318
332
|
|
|
319
333
|
type ENV_TYPES = string | number | boolean | undefined;
|
|
@@ -451,6 +465,12 @@ export class ENV {
|
|
|
451
465
|
static get EFFECTSTREAM_SNAPSHOT_LAST_N_DAYS(): number {
|
|
452
466
|
return ENV.getConfig(definitions.EFFECTSTREAM_SNAPSHOT_LAST_N_DAYS);
|
|
453
467
|
}
|
|
468
|
+
static get EFFECTSTREAM_COALESCE_EMPTY_BLOCKS(): boolean {
|
|
469
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_COALESCE_EMPTY_BLOCKS);
|
|
470
|
+
}
|
|
471
|
+
static get EFFECTSTREAM_FINALIZED_STREAM_CAP(): number {
|
|
472
|
+
return ENV.getConfig(definitions.EFFECTSTREAM_FINALIZED_STREAM_CAP);
|
|
473
|
+
}
|
|
454
474
|
|
|
455
475
|
public static getConfig<T>(config: ConfigDefinition): T {
|
|
456
476
|
switch (config.type) {
|