@effectstream/utils 0.100.26 → 0.100.27

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/config.ts +12 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effectstream/utils",
3
- "version": "0.100.26",
3
+ "version": "0.100.27",
4
4
  "license": "MIT",
5
5
  "homepage": "https://effectstream.github.io/docs/",
6
6
  "repository": {
package/src/config.ts CHANGED
@@ -321,6 +321,13 @@ const definitions: Record<string, ConfigDefinition> = {
321
321
  description:
322
322
  "Fold consecutive empty catch-up blocks into one DB transaction when behind the chain tip. Default: false.",
323
323
  },
324
+ EFFECTSTREAM_LAG_THRESHOLD_MS: {
325
+ key: "EFFECTSTREAM_LAG_THRESHOLD_MS",
326
+ type: "number",
327
+ defaultValue: undefined,
328
+ description:
329
+ "Override the lag threshold (ms) that gates empty-block coalescing and lag logging. When unset, defaults to 20× the main clock's block time, falling back to 60 s when no blockTimeMS is exposed.",
330
+ },
324
331
  EFFECTSTREAM_FINALIZED_STREAM_CAP: {
325
332
  key: "EFFECTSTREAM_FINALIZED_STREAM_CAP",
326
333
  type: "number",
@@ -471,6 +478,11 @@ export class ENV {
471
478
  static get EFFECTSTREAM_FINALIZED_STREAM_CAP(): number {
472
479
  return ENV.getConfig(definitions.EFFECTSTREAM_FINALIZED_STREAM_CAP);
473
480
  }
481
+ static get EFFECTSTREAM_LAG_THRESHOLD_MS(): number | undefined {
482
+ const raw = getEnv(definitions.EFFECTSTREAM_LAG_THRESHOLD_MS.key);
483
+ if (raw == null || raw === "") return undefined;
484
+ return parseInt(raw, 10);
485
+ }
474
486
 
475
487
  public static getConfig<T>(config: ConfigDefinition): T {
476
488
  switch (config.type) {