Skip to content

Commit

Permalink
Update kit version
Browse files Browse the repository at this point in the history
  • Loading branch information
neoxelox committed Apr 16, 2024
1 parent 4f4cd12 commit 2511902
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
10 changes: 6 additions & 4 deletions cmd/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,22 @@ func NewAPI(ctx context.Context, config config.Config) (*API, error) {
})

observerMiddleware := kitMiddleware.NewObserver(observer, kitMiddleware.ObserverConfig{})
timeoutMiddleware := kitMiddleware.NewTimeout(observer, kitMiddleware.TimeoutConfig{
// Allow timeout handler to respond before response writer is closed
Timeout: config.Service.GracefulTimeout - (1 * time.Second),
})
recoverMiddleware := kitMiddleware.NewRecover(observer, kitMiddleware.RecoverConfig{})
secureMiddleware := kitMiddleware.NewSecure(observer, kitMiddleware.SecureConfig{
CORSAllowOrigins: kitUtil.Pointer(config.Server.Origins),
})
localizerMiddleware := kitMiddleware.NewLocalizer(observer, localizer, kitMiddleware.LocalizerConfig{})
timeoutMiddleware := kitMiddleware.NewTimeout(observer, kitMiddleware.TimeoutConfig{
Timeout: config.Service.GracefulTimeout,
})
errorMiddleware := kitMiddleware.NewError(observer, kitMiddleware.ErrorConfig{})

server.Use(observerMiddleware.HandleRequest)
server.Use(timeoutMiddleware.Handle)
server.Use(recoverMiddleware.HandleRequest)
server.Use(secureMiddleware.Handle)
server.Use(localizerMiddleware.Handle)
server.Use(timeoutMiddleware.Handle)
server.Use(errorMiddleware.Handle)

api := server.Default()
Expand Down Expand Up @@ -193,6 +194,7 @@ func NewAPI(ctx context.Context, config config.Config) (*API, error) {
CacheReadTimeout: kitUtil.Pointer(config.Cache.ReadTimeout),
CacheWriteTimeout: kitUtil.Pointer(config.Cache.WriteTimeout),
CacheDialTimeout: kitUtil.Pointer(config.Cache.DialTimeout),
TaskDefaultRetry: kitUtil.Pointer(0),
})

/* REPOSITORIES */
Expand Down
1 change: 1 addition & 0 deletions cmd/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func NewCLI(ctx context.Context, config config.Config) (*CLI, error) {
CacheReadTimeout: kitUtil.Pointer(config.Cache.ReadTimeout),
CacheWriteTimeout: kitUtil.Pointer(config.Cache.WriteTimeout),
CacheDialTimeout: kitUtil.Pointer(config.Cache.DialTimeout),
TaskDefaultRetry: kitUtil.Pointer(0),
})

/* REPOSITORIES */
Expand Down
1 change: 1 addition & 0 deletions cmd/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ func NewWorker(ctx context.Context, config config.Config) (*Worker, error) {
CacheReadTimeout: kitUtil.Pointer(config.Cache.ReadTimeout),
CacheWriteTimeout: kitUtil.Pointer(config.Cache.WriteTimeout),
CacheDialTimeout: kitUtil.Pointer(config.Cache.DialTimeout),
TaskDefaultRetry: kitUtil.Pointer(0),
})

/* REPOSITORIES */
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/leporo/sqlf v1.4.0
github.com/mkideal/cli v0.2.7
github.com/neoxelox/errors v0.2.0
github.com/neoxelox/kit v0.30.0
github.com/neoxelox/kit v0.33.0
github.com/rs/xid v1.5.0
golang.org/x/text v0.14.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ github.com/neoxelox/errors v0.2.0 h1:AhvCMJAjUBFCP3PgZHbY6SS8Sc9fxx/DiawU5Cd5RxE
github.com/neoxelox/errors v0.2.0/go.mod h1:gCPnC7z8Qwswwz5Usv3WORxvan9Q6WSrDTvzaQyl7oM=
github.com/neoxelox/gilk v0.5.0 h1:Knw/TgSUnwPDIRJbqoTmG98gYsmKojNCJ5WAjALoWFc=
github.com/neoxelox/gilk v0.5.0/go.mod h1:Q+WgmSMKWd5UAaVjLSmGPbVD11AmHFhlo3QrPum0vo0=
github.com/neoxelox/kit v0.30.0 h1:Rpp/WKYZ/QDcPuFZrfyaA2aMYBzjJFoD3TNE0xjQbuw=
github.com/neoxelox/kit v0.30.0/go.mod h1:IgYpZ0XID15bSpHXCnrJA6to5j69fzkbn0knfsEpdAE=
github.com/neoxelox/kit v0.33.0 h1:9IlIuwVP3Bb+herHpDTLYEA9vFUKGCD1C67LD2hr3U8=
github.com/neoxelox/kit v0.33.0/go.mod h1:IgYpZ0XID15bSpHXCnrJA6to5j69fzkbn0knfsEpdAE=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
Expand Down

0 comments on commit 2511902

Please sign in to comment.