cloudflare / miniflare

🔥 Fully-local simulator for Cloudflare Workers. For the latest version, see https://github.com/cloudflare/workers-sdk/tree/main/packages/miniflare.
https://miniflare.dev
MIT License
3.78k stars 205 forks source link

[Miniflare 3] Avoid using temporary directory if possible #720

Closed mrbbot closed 1 year ago

mrbbot commented 1 year ago

Miniflare 2 persisted data in-memory between setOptions() calls when *Persist options were disabled. Whilst workerd has in-memory storage for Durable Objects, this is reset when workerd is restarted (i.e. when setOptions() is called). To retain Miniflare 2 behaviour in Miniflare 3, we actually persist to a temporary directory when *Persist options are disabled. There are cases where we don't need the temporary directory though: if we have no storage bindings configured, cache is false, and unsafeEphemeralDurableObjects is true. This change ensures we don't write to the temporary directory in these cases.

Ref: https://github.com/cloudflare/workers-sdk/issues/4167

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: 30ac489b4f286966e4756c240d108870b4b3abfa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR