Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

[dev] fix: properly route to new preview id after reload #1117

Merged
merged 1 commit into from
Mar 3, 2020

Conversation

EverlastingBugstopper
Copy link
Contributor

Fixes #1082 and might fix #1107

We keep preview_id in an Arc<Mutex so that when a reload is detected on another thread, the dev server can properly route new requests to the new preview_id. Previously, the server would only attempt to acquire the lock every couple of minutes. After moving the lock acquisition to service_fn from make_service_fn, the lock is acquired on every request, making sure that each request is going to the right version of the script.

@tomByrer
Copy link
Contributor

tomByrer commented Mar 3, 2020

Previously, the server would only attempt to acquire the lock every couple of minutes

That would explain why small changes sometimes would not take.

@EverlastingBugstopper
Copy link
Contributor Author

Yup! We're going to try to get this fix into a point release today.

@EverlastingBugstopper EverlastingBugstopper merged commit b28ccfd into master Mar 3, 2020
@delete-merged-branch delete-merged-branch bot deleted the avery/fix-dev-reload branch March 3, 2020 17:38
@EverlastingBugstopper EverlastingBugstopper mentioned this pull request Mar 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[dev] On change, cloudflared tunnel breaks [dev] Worker updates not seen in terminal until restarting dev
3 participants