Skip to content

Commit c2da109

Browse files
committed
ref(deisctl): stop/uninstall store in order
1 parent a3dc69e commit c2da109

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

deisctl/cmd/cmd.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,14 @@ func stopDefaultServices(b backend.Backend, wg *sync.WaitGroup, outchan chan str
221221
wg.Wait()
222222

223223
outchan <- fmt.Sprintf("Storage subsystem...")
224-
b.Stop([]string{"store-gateway", "store-volume", "store-metadata", "store-monitor", "store-daemon"}, wg, outchan, errchan)
224+
b.Stop([]string{"store-volume", "store-gateway"}, wg, outchan, errchan)
225+
wg.Wait()
226+
b.Stop([]string{"store-metadata"}, wg, outchan, errchan)
227+
wg.Wait()
228+
b.Stop([]string{"store-daemon"}, wg, outchan, errchan)
229+
wg.Wait()
230+
b.Stop([]string{"store-monitor"}, wg, outchan, errchan)
225231
wg.Wait()
226-
227232
}
228233

229234
func Restart(b backend.Backend, targets []string) error {
@@ -379,7 +384,13 @@ func uninstallAllServices(b backend.Backend, wg *sync.WaitGroup, outchan chan st
379384
wg.Wait()
380385

381386
outchan <- fmt.Sprintf("Storage subsystem...")
382-
b.Destroy([]string{"store-gateway", "store-volume", "store-metadata", "store-monitor", "store-daemon"}, wg, outchan, errchan)
387+
b.Destroy([]string{"store-volume", "store-gateway"}, wg, outchan, errchan)
388+
wg.Wait()
389+
b.Destroy([]string{"store-metadata"}, wg, outchan, errchan)
390+
wg.Wait()
391+
b.Destroy([]string{"store-daemon"}, wg, outchan, errchan)
392+
wg.Wait()
393+
b.Destroy([]string{"store-monitor"}, wg, outchan, errchan)
383394
wg.Wait()
384395

385396
return nil

0 commit comments

Comments
 (0)