Skip to content
File

Blob: src/worker/do/repo/repoConfig.ts

typescript9 lines
1export function getConfig(env: Env) {
2 const idleMins = Number(env.REPO_DO_IDLE_MINUTES ?? 30);
3 const clamp = (n: number, min: number, max: number) =>
4 Number.isFinite(n) ? Math.max(min, Math.min(max, Math.floor(n))) : min;
5 return {
6 idleMs: clamp(idleMins, 1, 60 * 24 * 7) * 60 * 1000,
7 };
8}