diegosouzapw/OmniRoute · error

cache_size must be a positive KiB value between 1 and 100000

Error message

cache_size must be a positive KiB value between 1 and 1000000

What it means

Error "cache_size must be a positive KiB value between 1 and 1000000" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/db/optimizationSettings.ts:64

}

function normalizeVacuumHour(value: unknown, fallback: number): number {
  const numeric = Number(value);
  if (!Number.isFinite(numeric)) return fallback;
  return Math.min(23, Math.max(0, Math.floor(numeric)));
}

function normalizeStoredCacheSizeKb(value: unknown, fallback: number): number {
  const numeric = Number(value);
  if (!Number.isFinite(numeric)) return fallback;
  const cacheSizeKb = Math.floor(numeric);
  if (cacheSizeKb < 1 || cacheSizeKb > 1000000) return fallback;
  return cacheSizeKb;
}

function requireCacheSizeKb(value: number): number {
  if (!Number.isInteger(value) || value < 1 || value > 1000000) {
    throw new Error("cache_size must be a positive KiB value between 1 and 1000000");
  }
  return value;
}

function mergeOptimizationSettings(
  target: DatabaseOptimizationSettings,
  value: unknown
): DatabaseOptimizationSettings {
  if (!isRecord(value)) return target;
  return {
    ...target,
    autoVacuumMode: normalizeAutoVacuumMode(value.autoVacuumMode, target.autoVacuumMode),
    scheduledVacuum:
      typeof value.scheduledVacuum === "string" &&
      ["never", "daily", "weekly", "monthly"].includes(value.scheduledVacuum)
        ? (value.scheduledVacuum as DatabaseOptimizationSettings["scheduledVacuum"])
        : target.scheduledVacuum,
    vacuumHour: normalizeVacuumHour(value.vacuumHour, target.vacuumHour),

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/db/optimizationSettings.ts:64 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/fbca170a0c255798. Report an issue: GitHub.