Skip to content

Execute context once on startup / CloudFlare Workers #1030

Answered by yusukebe
sntmt asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @sntmt !

You can't do it, and you don't have to do it if you want the application to run on Cloudflare Workers. On Cloudflare Workers, a Worker is launched for each request. It is not guaranteed that a Worker is always running. So, even if it has a value as static, it may disappear, so it must be retrieved from Bindings each time.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@sntmt
Comment options

Answer selected by sntmt
Comment options

You must be logged in to vote
1 reply
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants