rescue
The blocklet server rescue command is a recovery utility designed to restart blocklets that have stopped running after a specified time. This is particularly useful for bringing blocklets back online after an unexpected server shutdown or crash, saving you from having to restart each one manually.
Usage#
blocklet server rescue --stopped-after <time> [options]Options#
Option | Description | Required |
|---|---|---|
| A valid timestamp. The command will only attempt to restart blocklets that were stopped after this specific time. The time should be in a format recognized by | Yes |
| By default, the command skips blocklets that are already in a | No |
Workflow#
The command follows a specific sequence to determine which blocklets to restart:
Example#
Imagine your server experienced an unexpected reboot around 8:30 AM. You can use the rescue command to restart any production blocklets that went offline.
blocklet server rescue --stopped-after "2023-11-01T08:25:00Z"This command will scan all blocklets and attempt to restart those that stopped after 8:25 AM UTC on November 1, 2023. It will skip any blocklets in development mode or any that are already running.
Sample Output#
$ blocklet server rescue --stopped-after "2023-11-01T08:25:00Z"
info Skip development blocklet: My Dev Project
info Skip running blocklet: Static Site
info Skip blocklet: Old Archived App because it was not stopped after 2023-11-01T08:25:00Z
⠼ Starting blocklet: Main App
✔ Starting blocklet: Main App
⠼ Starting blocklet: API Service
✖ Failed to start blocklet API Service connect ETIMEDOUT
✔ Done!In this output, you can see that the command successfully restarted Main App but failed to start API Service. The other blocklets were skipped for the reasons stated.
After running the rescue command, you can verify the outcome by checking the current state of all services with the status command. If any blocklets failed to restart, you can investigate the cause by checking the relevant logs with the logs command.