Skip to content

Commit 856d48f

Browse files
authored
Make the container's sleepAfter configurable, default to 1min (#60)
1 parent 16d74f0 commit 856d48f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

worker/env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ interface Env {
3939
SCALE_DOWN_IDLE_TIME?: string;
4040
TRANSLATION_MIXING_MODE?: string;
4141
USE_DISPATCHER?: string;
42+
SLEEP_AFTER?: string;
4243
}

worker/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class TranscriberContainer extends Container {
4242
// Longer = Fewer cold starts, but uses more resources when idle
4343
// For pool-based routing: Keep this longer (containers serve many sessions)
4444
// For session-based routing: Keep this shorter (containers are session-specific)
45-
sleepAfter = '10m';
45+
sleepAfter = this.env.SLEEP_AFTER || '1m';
4646

4747
// Pass environment variables to the container
4848
envVars = {

0 commit comments

Comments
 (0)