Skip to content

Commit f8eb260

Browse files
committed
Fix duplicated "unexpected shutdowns" paragraph in Rules of Durable Objects
The paragraph under "Design for unexpected shutdowns" rendered twice: an inline hardcoded copy plus the working-without-shutdown-hooks partial, which begins with the same sentence. Remove the inline paragraph so the partial is the single source of truth, and preserve the "at any time" wording by adding it to the partial.
1 parent a0aa31d commit f8eb260

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

src/content/docs/durable-objects/best-practices/rules-of-durable-objects.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,8 +1441,6 @@ export class ChatRoom extends DurableObject<Env> {
14411441

14421442
### Design for unexpected shutdowns
14431443

1444-
Durable Objects may shut down at any time due to deployments, inactivity, or runtime decisions. Rather than relying on shutdown hooks (which are not provided), design your application to write state incrementally.
1445-
14461444
<Render file="working-without-shutdown-hooks" product="durable-objects" />
14471445

14481446
## Anti-patterns to avoid

src/content/partials/durable-objects/working-without-shutdown-hooks.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{}
33
---
44

5-
Durable Objects may shut down due to deployments, inactivity, or runtime decisions. Rather than relying on shutdown hooks (which are not provided), design your application to write state incrementally.
5+
Durable Objects may shut down at any time due to deployments, inactivity, or runtime decisions. Rather than relying on shutdown hooks (which are not provided), design your application to write state incrementally.
66

77
Shutdown hooks or lifecycle callbacks that run before shutdown are not provided because Cloudflare cannot guarantee these hooks would execute in all cases, and external software may rely too heavily on these (unreliable) hooks.
88

0 commit comments

Comments
 (0)