You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google App Engine
Hi,
Is there a way to configure a shutdown hook in the node js flex environment?
Goal is to run some code when instance(s) is(are) shutdown/recycled. I know there's an option for a shutdown hook in some of the standard env's (Python) and wanted to know what the equivalent option is for node js - couldn't find anything in the docs.
Thanks
Jordan (Cloud Platform Support)
unread,
Mar 20, 2018, 1:20:27 PM3/20/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google App Engine
As per the documentation App Engine sends a SIGTERM signal to your application container running within the instance to notify your application that it is about to be shutdown.
You can read from the stdin in Node.js to run a function once the signal is received. Normally you should have 30 seconds to receive the signal and complete the function, but this is not guaranteed and may be cut short due to unforeseen network and/or resource issues as explained in the documentation.
- Note that Google Groups is for general product discussions. For technical support in setting up the shutdown hook it is recommended post your detailed questions to Stack Overflow using the supported Cloud tags.