Enabling Auto Restart
With Auto Restart, follow these steps to enable it in your application’s configuration file:1
Config file
Create or edit your
squarecloud.app
or squarecloud.config
file.How to create a configuration file
The squarecloud.app file is a configuration file that will be used to configure your application; it will be used to define the name, description, version, main file, among other things.
2
Locate parameter
Locate the
AUTORESTART
parameter in the configuration file. Or add it if it doesn’t exist.3
Set value
Set the value of
AUTORESTART
to true
.Here’s an example of how to enable Auto Restart in your configuration file:squarecloud.app OR squarecloud.config
How Auto Restart Works
Auto Restart is a proactive feature that monitors the health of your application. If your application crashes or becomes unresponsive, Auto Restart takes action to get it back up and running.1
Application goes down
When your application crashes or becomes unresponsive, Auto Restart detects the issue if AUTORESTART is enabled in your configuration file.
2
Application Uptime Verification
If the application uptime is > 60 seconds, will proceed to next step.
3
Application Exit Status Verification
If the application exit status is 1, will proceed to next step.
4
Application Recent Restart Verification
If the application didn’t restart in the last 60 minutes, will proceed to next step.
5
Application Exception Verification
If the application logs contain any of the excluded errors, Auto Restart will not restart the application.Examples of excluded errors include:If the application logs contain any of these errors, Auto Restart will not restart the application.
6
Application Restart
AUTORESTART automatically restarts your application to bring it back. 😉
Cooldown between restarts is 60 minutes.
Best Practices
Here are some best practices to make the most of Auto Restart:- Regularly review your application’s logs to understand the reasons for any crashes or restarts. This can help you identify and address underlying issues.
- Keep your MAIN file and memory allocation parameters up-to-date to ensure optimal performance and resource usage.
Conclusion
Auto Restart in Square Cloud is a valuable feature that enhances the reliability of your application. By automatically handling crashes and unresponsiveness, it helps maintain a seamless user experience. Ensure that you have a plan with Auto Restart enabled and configure it in yoursquarecloud.app
or squarecloud.config
file to make the most of this feature.