mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 12:40:24 +03:00
FS: remove .minio directory if .minio/multipart is empty. (#1899)
fixes #1886
This commit is contained in:
committed by
Harshavardhana
parent
de1c7d33eb
commit
e2743d05e8
@@ -17,9 +17,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -27,6 +29,17 @@ const (
|
||||
blockSizeV1 = 10 * 1024 * 1024 // 10MiB.
|
||||
)
|
||||
|
||||
// Register callback functions that needs to be called when process shutsdown.
|
||||
// For now, SIGINT triggers the callbacks, in future controller can trigger
|
||||
// shutdown callbacks.
|
||||
func registerShutdown(callback func()) {
|
||||
go func() {
|
||||
trapCh := signalTrap(os.Interrupt, syscall.SIGTERM)
|
||||
<-trapCh
|
||||
callback()
|
||||
}()
|
||||
}
|
||||
|
||||
// House keeping code needed for FS.
|
||||
func fsHouseKeeping(storageDisk StorageAPI) error {
|
||||
// Attempt to create `.minio`.
|
||||
|
||||
Reference in New Issue
Block a user