Replies: 1 comment
-
You should be able to do it the same way you would have done in a normal process, i.e. listening to process SIGTERM and SIGINT and closing the connections in the callback. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Since a sandbox is sandboxed, I need to ensure connections to databases are initiated when the sandbox is created.
I noticed that the sandbox seems to be created the first time that the queue is ran.
It then seems to reuse that same sandbox for multiple jobs.
(I dont know how it determines when a new sandbox is created, is it a new sandbox instance for each unique queue? Each concurrent instance?)
So ideally then I want to catch when the sandbox is destroyed, and use it as an opportunity to clean up connections to databases, and whatever handles i have open.
Also if multiple sandbox's are made for concurrent instances, than are sandboxes left idle, and if so, can they be evicted after a certain duration?
I cannot seem to find anything on this anywhere.
Beta Was this translation helpful? Give feedback.
All reactions