refactor: rename pre-restore trigger to scheduler-pre-restore

This better reflects what the trigger does, and allows us to use the pre-restore trigger at the beginning of the ps:restore command.
This commit is contained in:
Jose Diaz-Gonzalez
2022-11-22 23:18:45 -05:00
parent 77fbd676bc
commit 6fed37b408
6 changed files with 32 additions and 7 deletions

View File

@@ -115,8 +115,8 @@ func RestartProcess(appName string, processName string) error {
// Restore ensures an app that should be running is running on boot
func Restore(appName string) error {
scheduler := common.GetAppScheduler(appName)
if err := common.PlugnTrigger("pre-restore", []string{scheduler, appName}...); err != nil {
return fmt.Errorf("Error running pre-restore: %s", err)
if err := common.PlugnTrigger("scheduler-pre-restore", []string{scheduler, appName}...); err != nil {
return fmt.Errorf("Error running scheduler-pre-restore: %s", err)
}
common.LogInfo1("Clearing potentially invalid proxy configuration")

View File

@@ -74,6 +74,10 @@ func CommandRestart(appName string, processName string, allApps bool, parallelCo
// CommandRestore starts previously running apps e.g. after reboot
func CommandRestore(appName string, allApps bool, parallelCount int) error {
if err := common.PlugnTrigger("pre-restore", []string{}...); err != nil {
return fmt.Errorf("Error running pre-restore: %s", err)
}
if allApps {
if err := restorePrep(); err != nil {
return err