Clean entire tmp-old on restart (#15979)

This commit is contained in:
Klaus Post
2022-10-31 15:27:50 +01:00
committed by GitHub
parent b57fbff7c1
commit ecc932d5dd
7 changed files with 19 additions and 42 deletions

View File

@@ -666,30 +666,16 @@ func closeStorageDisks(storageDisks ...StorageAPI) {
wg.Wait()
}
func initStorageDisksWithErrorsWithoutHealthCheck(endpoints Endpoints) ([]StorageAPI, []error) {
// Bootstrap disks.
storageDisks := make([]StorageAPI, len(endpoints))
g := errgroup.WithNErrs(len(endpoints))
for index := range endpoints {
index := index
g.Go(func() (err error) {
storageDisks[index], err = newStorageAPIWithoutHealthCheck(endpoints[index])
return err
}, index)
}
return storageDisks, g.Wait()
}
// Initialize storage disks for each endpoint.
// Errors are returned for each endpoint with matching index.
func initStorageDisksWithErrors(endpoints Endpoints) ([]StorageAPI, []error) {
func initStorageDisksWithErrors(endpoints Endpoints, healthCheck bool) ([]StorageAPI, []error) {
// Bootstrap disks.
storageDisks := make([]StorageAPI, len(endpoints))
g := errgroup.WithNErrs(len(endpoints))
for index := range endpoints {
index := index
g.Go(func() (err error) {
storageDisks[index], err = newStorageAPI(endpoints[index])
storageDisks[index], err = newStorageAPI(endpoints[index], healthCheck)
return err
}, index)
}