mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
Move initGracefulShutdown before objectLayer initialization (#2468)
This commit is contained in:
parent
7c7eb1475d
commit
a4691611a7
@ -65,10 +65,6 @@ func newObjectLayerFactory(disks, ignoredDisks []string) func() ObjectLayer {
|
|||||||
err = cleanupOldBucketPolicyConfigs()
|
err = cleanupOldBucketPolicyConfigs()
|
||||||
fatalIf(err, "Unable to clean up bucket policy from config directory.")
|
fatalIf(err, "Unable to clean up bucket policy from config directory.")
|
||||||
|
|
||||||
// Initialize and monitor shutdown signals.
|
|
||||||
err = initGracefulShutdown(os.Exit)
|
|
||||||
fatalIf(err, "Unable to initialize graceful shutdown operation")
|
|
||||||
|
|
||||||
// Register the callback that should be called when the process shuts down.
|
// Register the callback that should be called when the process shuts down.
|
||||||
globalShutdownCBs.AddObjectLayerCB(func() errCode {
|
globalShutdownCBs.AddObjectLayerCB(func() errCode {
|
||||||
if sErr := objAPI.Shutdown(); sErr != nil {
|
if sErr := objAPI.Shutdown(); sErr != nil {
|
||||||
@ -95,6 +91,10 @@ func configureServerHandler(srvCmdConfig serverCmdConfig) http.Handler {
|
|||||||
storageRPCs, err := newRPCServer(srvCmdConfig)
|
storageRPCs, err := newRPCServer(srvCmdConfig)
|
||||||
fatalIf(err, "Unable to initialize storage RPC server.")
|
fatalIf(err, "Unable to initialize storage RPC server.")
|
||||||
|
|
||||||
|
// Initialize and monitor shutdown signals.
|
||||||
|
err = initGracefulShutdown(os.Exit)
|
||||||
|
fatalIf(err, "Unable to initialize graceful shutdown operation")
|
||||||
|
|
||||||
newObjectLayerFn := newObjectLayerFactory(srvCmdConfig.disks, srvCmdConfig.ignoredDisks)
|
newObjectLayerFn := newObjectLayerFactory(srvCmdConfig.disks, srvCmdConfig.ignoredDisks)
|
||||||
// Initialize API.
|
// Initialize API.
|
||||||
apiHandlers := objectAPIHandlers{
|
apiHandlers := objectAPIHandlers{
|
||||||
|
Loading…
Reference in New Issue
Block a user