chore: move function to internal
This commit is contained in:
@@ -315,6 +315,22 @@ func removeProcfile(appName string) error {
|
|||||||
return os.Remove(procfile)
|
return os.Remove(procfile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func restorePrep() error {
|
||||||
|
apps, err := common.DokkuApps()
|
||||||
|
if err != nil {
|
||||||
|
common.LogWarn(err.Error())
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, appName := range apps {
|
||||||
|
if err := common.PlugnTrigger("proxy-clear-config", []string{appName}...); err != nil {
|
||||||
|
return fmt.Errorf("Error clearing proxy config: %s", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func scaleReport(appName string) error {
|
func scaleReport(appName string) error {
|
||||||
scalefilePath := getScalefilePath(appName)
|
scalefilePath := getScalefilePath(appName)
|
||||||
lines, err := common.FileToSlice(scalefilePath)
|
lines, err := common.FileToSlice(scalefilePath)
|
||||||
|
|||||||
@@ -117,22 +117,6 @@ func Restore(appName string) error {
|
|||||||
return Start(appName)
|
return Start(appName)
|
||||||
}
|
}
|
||||||
|
|
||||||
func RestorePrep() error {
|
|
||||||
apps, err := common.DokkuApps()
|
|
||||||
if err != nil {
|
|
||||||
common.LogWarn(err.Error())
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, appName := range apps {
|
|
||||||
if err := common.PlugnTrigger("proxy-clear-config", []string{appName}...); err != nil {
|
|
||||||
return fmt.Errorf("Error clearing proxy config: %s", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start starts the app
|
// Start starts the app
|
||||||
func Start(appName string) error {
|
func Start(appName string) error {
|
||||||
imageTag, _ := common.GetRunningImageTag(appName)
|
imageTag, _ := common.GetRunningImageTag(appName)
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ func CommandRestart(appName string, allApps bool, parallelCount int) error {
|
|||||||
// CommandRestore starts previously running apps e.g. after reboot
|
// CommandRestore starts previously running apps e.g. after reboot
|
||||||
func CommandRestore(appName string, allApps bool, parallelCount int) error {
|
func CommandRestore(appName string, allApps bool, parallelCount int) error {
|
||||||
if allApps {
|
if allApps {
|
||||||
if err := RestorePrep(); err != nil {
|
if err := restorePrep(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ func CommandRestore(appName string, allApps bool, parallelCount int) error {
|
|||||||
if appName == "" {
|
if appName == "" {
|
||||||
common.LogWarn("Restore specified without app, assuming --all")
|
common.LogWarn("Restore specified without app, assuming --all")
|
||||||
|
|
||||||
if err := RestorePrep(); err != nil {
|
if err := restorePrep(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return common.RunCommandAgainstAllApps(Restore, "restore", parallelCount)
|
return common.RunCommandAgainstAllApps(Restore, "restore", parallelCount)
|
||||||
|
|||||||
Reference in New Issue
Block a user