-
Notifications
You must be signed in to change notification settings - Fork 1k
Clean up containers started by local dev during process exit hook instead #10099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 7fd0fc1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
d350ace
to
b4808e4
Compare
b4808e4
to
ee79aa5
Compare
ee79aa5
to
262b2b7
Compare
|
||
onBundleStart(_: BundleStartEvent) { | ||
// Ignored in local runtime | ||
process.on("exit", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really sure if this is the right spot to register this
Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Various questions, mainly so I understand better. Looks good otherwise.
previously these methods were async so we could not call them from
process.on('exit')
. by using synchronous apis instead to run docker commands, we can actually do cleanup from that hook, which simplifies a lot of the vite plugin cleanup code and also ensures proper cleanup if you run and stop wrangler programmatically (e.g. using something likeconcurrently
).Vite manual testing:
I don't think we can test this with the vite plugin because we start and stop the vite server in vitest's global setup hook, which runs after test hooks like
afterAll
.You can manually test this by:
container-app
in the vite playground/start
docker ps
docker ps
again to verify no containers are still running