So I think the only way is calling an api that make the integration
For now, yes.
You can create a feature request for it, as it sounds like there going to be some use-cases - like yours - when it's heplful.
Great, i will create it
you should try it out 😉
Hi @Steven I don't understand you?
process.on('SIGTERM', async () => .....) but it doesn't work.
What happened when you did this?
It doesnt run the code, I tried to debug creating a document in an appwrite collection but it doesnt create it
nvm..ya i can't get any signal to catch
I've just tested it with all kind of stop process, and same..
i'm not sure if it's docker and how we're starting nodemon or im using the wrong signal 🤷🏼♂️
Yes, this also what I've seen that it depends on how the Node (pm2) is running and what how the process is being terminated.
It sounds like it can be added here https://github.com/utopia-php/orchestration/blob/main/src/Orchestration/Adapter/DockerCLI.php#L437
Something like this.
...
Console::execute("docker exec {$name} strat-termination"
$result = Console::execute("docker rm " . ($force ? '--force': '') . " {$name}", '', $stdout, $stderr);
...
For custom termination life-cycle.
And then the user should make sure is termination is very short, like other life-cycles logic.
Theoretically, docker stop should send some signal, but I'm not sure which and why it's not propagating to the express server
I've run a few tests, and no SIG*
was received.
It seems like that pm2 encourage the use of pm2-runtime
inside Docker.
Hi Binyamin,can you help me with a workaround?
Docker does send signals but because of how the open runtimes are structured, the actual node function doesn’t receive that signal. Its one of the optimizations which we can make.
Docker sends the signals to the pid 1 which here is npm script (the host start.sh, which creates a shell process with pid1), and then that signal is not relayed further hence our app doesn’t receive it
so were you able to make any modifications to get the signal to propagate?
That's actually a very good analyze of that matter, thanks
It required some additional checks, and the idea was great. I've created a PR for that https://github.com/open-runtimes/open-runtimes/pull/171
I didn’t get a chance to look into it in detail, but from high level it does look ok, I am only concerned a bit on moving the requite outside. Ideally this should not impact, but I don’t have the reasoning why it was put under in the first place. Also there should be a better way of doing this instead adding into every runtime, I have plans on looking into it but struggling with finding time😅
Recommended threads
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...
- What Query's are valid for GetDocument?
Documentation shows that Queries are valid here, but doesn't explain which queries are valid. At first I presumed this to be a bug, but before creating a githu...
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...