Skip to content

Commit 5c77208

Browse files
committed
fix[installer]: add delay before prune
1 parent 25403bb commit 5c77208

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

installer/updater/client.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,15 @@ func (c *UpdaterClient) UpdateToNewVersion(version, edition, changelog string) e
161161
config.Logger().Info("UTMStack updated to version %s-%s", version, edition)
162162
config.Updating = false
163163

164+
time.Sleep(3 * time.Minute)
165+
164166
err = utils.RunCmd("docker", "image", "prune", "-a", "-f")
165167
if err != nil {
166168
config.Logger().ErrorF("error cleaning up old Docker images after update: %v", err)
167169
}
168170

169171
// Restart service to load new installer binary
170172
if cnf.Branch == "prod" || cnf.Branch == "" {
171-
config.Logger().Info("Restarting service to load new installer binary...")
172173
go func() {
173174
time.Sleep(5 * time.Second)
174175
utils.RestartService("UTMStackComponentsUpdater")
@@ -179,8 +180,6 @@ func (c *UpdaterClient) UpdateToNewVersion(version, edition, changelog string) e
179180
}
180181

181182
func (c *UpdaterClient) UpdateInstaller(version string) error {
182-
config.Logger().Info("Updating installer to version %s...", version)
183-
184183
execPath, err := os.Executable()
185184
if err != nil {
186185
return fmt.Errorf("error getting executable path: %v", err)
@@ -225,7 +224,6 @@ func (c *UpdaterClient) UpdateInstaller(version string) error {
225224
return fmt.Errorf("error replacing installer binary: %v", err)
226225
}
227226

228-
config.Logger().Info("Installer updated successfully to version %s", version)
229227
return nil
230228
}
231229

installer/updater/window.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@ var windowConfig *MaintenanceWindow
1717

1818
func UpdateWindowConfig() {
1919
for {
20-
window, err := getWindowMaintaince()
21-
if err != nil {
22-
if !IsBackendMaintenanceError(err) {
23-
config.Logger().ErrorF("Error getting maintenance window config: %v", err)
24-
}
25-
}
26-
20+
window, _ := getWindowMaintaince()
2721
if window != nil {
2822
windowConfig = window
2923
}

0 commit comments

Comments
 (0)