Skip to content

Commit

Permalink
return ObjectLayer from StartGatewayWithRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
peifan-tes committed Jul 3, 2020
1 parent cc45051 commit e319827
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions cmd/gateway-main.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,11 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
handleSignals()
}


// StartGatewayWithRouter - handler for 'minio gateway <name>'.
func StartGatewayWithRouter(router *mux.Router, gw Gateway) http.Handler {
func StartGatewayWithRouter(router *mux.Router, gw Gateway) (http.Handler, ObjectLayer) {
if gw == nil {
logger.FatalIf(errUnexpected, "Gateway implementation not initialized")
return nil
return nil, nil
}

// Validate if we have access, secret set through environment.
Expand Down Expand Up @@ -400,7 +399,6 @@ func StartGatewayWithRouter(router *mux.Router, gw Gateway) http.Handler {
globalConfigSys.WatchConfigNASDisk(GlobalContext, newObject)
}


if globalCacheConfig.Enabled {
// initialize the new disk cache objects.
var cacheAPI CacheObjectLayer
Expand All @@ -422,5 +420,5 @@ func StartGatewayWithRouter(router *mux.Router, gw Gateway) http.Handler {
globalSafeMode = false
globalObjLayerMutex.Unlock()

return handler
}
return handler, newObject
}

0 comments on commit e319827

Please sign in to comment.