-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to require process.send("online") before it goes online? #1234
Comments
owenallenaz
changed the title
Is it possible require process.send("online") before it goes online?
Is it possible to require process.send("online") before it goes online?
May 4, 2015
+1 |
I get it. We have to think about it in order to avoid losing usability for the rest of the users. Also there is maybe a workaround : stop the 'listen' event to be fired automatically and fire it manually when your process is ready. |
+1 |
This was referenced Jul 29, 2016
In your code, once your application is ready, do Available in pm2@next:
|
Closed
Merged
This was referenced May 22, 2017
Merged
This was referenced Mar 15, 2018
Closed
Merged
Merged
This was referenced Dec 7, 2021
Merged
This was referenced Jul 3, 2023
Merged
Closed
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From the docs on graceful reload I see there is a way to nofity pm2 for non-http type processes that the process is online via a
process.send('online')
. Would it be possible to have a configuration setting that requires that to be sent in order for a process to be considered booted in all circumstances, and not just in graceful reloads.This makes it very clear as developer where in the code you are notifying pm2 that your process is operational. In example, right now with graceful reload, pm2 assumes that my process is ready when it starts listening on something, but what if my process needs to listen to multiple things before it's "booted". In addition, when I first start it up I want to tell pm2 when I consider this boot a success. It's sort of an explicit over implicit type issue.
The text was updated successfully, but these errors were encountered: