Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Question] Should I manually cleanup/teardown in Cloudflare Workers? #1064

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

Open
g-otn opened this issue May 3, 2025 · 0 comments
Open

[Question] Should I manually cleanup/teardown in Cloudflare Workers? #1064

g-otn opened this issue May 3, 2025 · 0 comments

Comments

@g-otn
Copy link

g-otn commented May 3, 2025

Hello!

I'm using postgres inside a Cloudflare Worker.

I'm wondering: Assuming all operations are properly awaited, if it's necessary to manually call sql.end() at the end when using Cloudflare Workers?

This library's docs says Cloudflare Workers allows this package to use the TCP socket API, which seems to automatically cleanup connection "on EOF". This, alongside the following examples, seems to imply it's not necessary:

However, I found this other example using this same library where the sql.end is observed:

Is this something specific to Hyperdrive connections, are some of the docs outdated or am I missing something else?

Sorry if it's not the right place to ask, but since the docs mention Cloudflare Workers with an example, I thought I'd ask.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant