Open Sustenance opened 8 years ago
Actually, don't merge this yet. I need to add a check that the node PID is still alive - just realized that it wasn't actively checking that on each serve
Thank you for your contribution. Could you please add spaces around { }
? And I am not sure if checking for $node_pid
in the if
statement is necessary. Finally, is there a need to run node_serve
recursively, instead of just continuing to curl_init
?
I can make the requested changes. I called node_serve recursively so that it would redo the check for the PID. Unfortunately, between yesterday and today, my hosting provider seems to be killing this node process immediately, so this is causing a race condition. Have you seen that at all, where node is started successfully via node.php, but an immedate ps -e doesn't show the PID? Manually starting node via SSH works fine
No, I haven't experienced it. Does $!
also return nothing?
Sorry I let this PR die. The host I was using (NameCheap) has an autokiller on its shared hosting apparently, and kills node as soon as it starts. Doesn't look like I'll be able to continue contributing.
Some shared hosting, such as Namecheap, will periodically kill off users' processes. This should allow the process to be restarted when a request comes in while the process is dead.