Skip to content

Commit 0162367

Browse files
authored
Merge pull request #169 from cloudflare/gv/activity-improvement
containers: If activity expired but inflight request, renew activity
2 parents 82ea775 + c88e29f commit 0162367

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

.changeset/thirty-groups-scream.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudflare/containers': patch
3+
---
4+
5+
Activity tracking refreshes timeout if inflight request instead of depending on alarm polling

src/lib/container.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,8 +1774,10 @@ export class Container<Env = Cloudflare.Env> extends DurableObject<Env> {
17741774

17751775
private isActivityExpired(): boolean {
17761776
if (this.inflightRequests > 0) {
1777+
this.renewActivityTimeout();
17771778
return false;
17781779
}
1780+
17791781
return this.sleepAfterMs <= Date.now();
17801782
}
17811783
}

0 commit comments

Comments
 (0)