Fixes for handler initialize

This commit is contained in:
Evgeniy Kulikov 2020-08-06 13:50:04 +03:00
parent e223876d53
commit 26dda9ef2b

View file

@ -130,19 +130,8 @@ func newApp(l *zap.Logger, v *viper.Viper) *App {
l.Fatal("could not prepare ObjectLayer", zap.Error(err)) l.Fatal("could not prepare ObjectLayer", zap.Error(err))
} }
{ // should prepare api.Handler: if caller, err = handler.New(l, obj); err != nil {
ctx, cancel := context.WithTimeout(context.Background(), conTimeout) l.Fatal("could not initialize API handler", zap.Error(err))
defer cancel()
apiParams := handler.Params{
Log: l,
Cli: cli,
Key: key,
}
if caller, err = handler.New(ctx, apiParams); err != nil {
l.Fatal("could not initialize API handler", zap.Error(err))
}
} }
return &App{ return &App{