Skip to content

Commit 08f4b0c

Browse files
committed
increase default to 10m
1 parent cbcda36 commit 08f4b0c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/sandbox/src/sandbox.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function getSandbox(
5353

5454
export class Sandbox<Env = unknown> extends Container<Env> implements ISandbox {
5555
defaultPort = 3000; // Default port for the container's Bun server
56-
sleepAfter: string | number = "3m"; // Sleep the sandbox if no requests are made in this timeframe
56+
sleepAfter: string | number = "10m"; // Sleep the sandbox if no requests are made in this timeframe
5757

5858
client: SandboxClient;
5959
private codeInterpreter: CodeInterpreter;

packages/sandbox/tests/get-sandbox.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ vi.mock('@cloudflare/containers', () => ({
66
Container: class Container {
77
ctx: any;
88
env: any;
9-
sleepAfter: string | number = '3m';
9+
sleepAfter: string | number = '10m';
1010
constructor(ctx: any, env: any) {
1111
this.ctx = ctx;
1212
this.env = env;
@@ -24,7 +24,7 @@ describe('getSandbox', () => {
2424

2525
// Create a fresh mock stub for each test
2626
mockStub = {
27-
sleepAfter: '3m',
27+
sleepAfter: '10m',
2828
setSandboxName: vi.fn(),
2929
setBaseUrl: vi.fn(),
3030
setSleepAfter: vi.fn((value: string | number) => {
@@ -89,7 +89,7 @@ describe('getSandbox', () => {
8989
const sandbox = getSandbox(mockNamespace, 'test-sandbox');
9090

9191
// Should remain default value from Container
92-
expect(sandbox.sleepAfter).toBe('3m');
92+
expect(sandbox.sleepAfter).toBe('10m');
9393
});
9494

9595
it('should accept various time string formats for sleepAfter', () => {

0 commit comments

Comments
 (0)