We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b411779 commit fe1d51fCopy full SHA for fe1d51f
1 file changed
src/lib/container.ts
@@ -585,9 +585,12 @@ export class Container<Env = unknown> extends DurableObject<Env> {
585
if (this.container.running) {
586
const timeoutInMs = parseTimeExpression(this.sleepAfter) * 1000;
587
// Type assertion needed until @cloudflare/workers-types is updated
588
- (this.container as any).setInactivityTimeout(timeoutInMs).catch((error: any) => {
589
- console.error('Failed to set inactivity timeout:', error);
590
- });
+ const containerAny = this.container as any;
+ if (typeof containerAny.setInactivityTimeout === 'function') {
+ containerAny.setInactivityTimeout(timeoutInMs).catch((error: any) => {
591
+ console.error('Failed to set inactivity timeout:', error);
592
+ });
593
+ }
594
}
595
596
0 commit comments