How to use Auto Restart in Square Cloud
Learn how to use Auto Restart in Square Cloud to automatically restart your application in case it crashes.
A Square Cloud exclusive technology, Auto Restart is a powerful feature in Square Cloud that allows your application to automatically restart in case it crashes. This ensures that your app remains accessible and functional even in the event of unexpected failures.
Enabling Auto Restart
With Auto Restart, follow these steps to enable it in your application’s configuration file:
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.
Locate parameter
Locate the AUTORESTART
parameter in the configuration file. Or add it if it doesn’t exist.
Set value
Set the value of AUTORESTART
to true
.
Here’s an example of how to enable Auto Restart in your configuration file:
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.
Application goes down
When your application crashes or becomes unresponsive, Auto Restart detects the issue if AUTORESTART is enabled in your configuration file.
Application Uptime Verification
If the application uptime is > 60 seconds, will proceed to next step.
Application Exit Status Verification
If the application exit status is 1, will proceed to next step.
Application Recent Restart Verification
If the application didn’t restart in the last 60 minutes, will proceed to next step.
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.
Application Restart
AUTORESTART automatically restarts your application to bring it back. 😉
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 your squarecloud.app
or squarecloud.config
file to make the most of this feature.
Was this page helpful?