mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Clean entire tmp-old on restart (#15979)
This commit is contained in:
@@ -206,11 +206,11 @@ func newLocalXLStorage(path string) (*xlStorage, error) {
|
||||
return newXLStorage(Endpoint{
|
||||
URL: &u,
|
||||
IsLocal: true,
|
||||
})
|
||||
}, true)
|
||||
}
|
||||
|
||||
// Initialize a new storage disk.
|
||||
func newXLStorage(ep Endpoint) (s *xlStorage, err error) {
|
||||
func newXLStorage(ep Endpoint, cleanUp bool) (s *xlStorage, err error) {
|
||||
path := ep.Path
|
||||
if path, err = getValidPath(path); err != nil {
|
||||
return nil, err
|
||||
@@ -247,7 +247,9 @@ func newXLStorage(ep Endpoint) (s *xlStorage, err error) {
|
||||
diskIndex: -1,
|
||||
}
|
||||
|
||||
bgFormatErasureCleanupTmp(s.diskPath) // cleanup any old data.
|
||||
if cleanUp {
|
||||
bgFormatErasureCleanupTmp(s.diskPath) // cleanup any old data.
|
||||
}
|
||||
|
||||
formatData, formatFi, err := formatErasureMigrate(s.diskPath)
|
||||
if err != nil && !errors.Is(err, os.ErrNotExist) {
|
||||
|
||||
Reference in New Issue
Block a user