1
0
mirror of https://github.com/minio/minio.git synced 2025-04-19 02:05:24 -04:00

Quit initializing disks process when term signal is invoked ()

This commit is contained in:
Anis Elleuch 2016-11-02 23:27:36 +01:00 committed by Harshavardhana
parent d9674f7524
commit e6965ca066

@ -17,6 +17,7 @@
package cmd
import (
"errors"
"net/url"
"time"
@ -204,7 +205,10 @@ func retryFormattingDisks(firstDisk bool, endpoints []*url.URL, storageDisks []S
defer close(doneCh)
// Wait on the jitter retry loop.
for retryCounter := range newRetryTimer(time.Second, time.Second*30, MaxJitter, doneCh) {
retryTimerCh := newRetryTimer(time.Second, time.Second*30, MaxJitter, doneCh)
for {
select {
case retryCounter := <-retryTimerCh:
// Attempt to load all `format.json`.
formatConfigs, sErrs := loadAllFormats(storageDisks)
if retryCounter > 5 {
@ -259,8 +263,10 @@ func retryFormattingDisks(firstDisk bool, endpoints []*url.URL, storageDisks []S
return genericFormatCheck(formatConfigs, sErrs)
} // else initialize the format for FS.
return initFormatFS(storageDisks[0])
} // Return here.
return nil
case <-globalServiceDoneCh:
return errors.New("Initializing data volumes gracefully stopped.")
}
}
}
// Initialize storage disks based on input arguments.