SkepticMystic
Explore posts from serversHow to only load worker once
I have a file that initialises a worker, and exports a function that posts a message to that worker. But if I import that function into multiple other files, the worker gets loaded each time. How can I prevent this to ensure only one instance of the worker is loaded, regardless of how many files I use the function in?
2 replies
docker compose up of Oak server throws: SyntaxError: Duplicate export of 'type'
I am just learning how to use Docker, and am trying to put up a container of an Oak server.
When running
docker compose up
, it throws the error mentioned above.
This doesn't happen locally, or on Deno Deploy. I'm not really sure where to start?
Can I somehow ignore this error, or is it actually a problem?
My docker-compose.yml
is:
And Dockerfile
:
The full error is:
Any help would be greatly appreciated, thank you2 replies
Is there an event that triggers when an Oak Deploy instance is closing?
I cannot find anything in the Deploy docs, specifically.
But I see that the Oak
app
runs a callback when the server closes. Something like this should work, I think:
But the console log doesn't run. Maybe the way Deploy closes instances doesn't allow for this?
Any advice would be really helpful1 replies