Skip to content

Commit

Permalink
Only set Gin mode once
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-woods committed Sep 24, 2021
1 parent 56e9934 commit c9a31ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion httpserver/ginrouter/default.go
Expand Up @@ -2,15 +2,20 @@ package ginrouter

import (
"context"
"sync"

"github.com/gin-gonic/gin"

"github.com/circleci/ex/o11y"
"github.com/circleci/ex/o11y/wrappers/o11ygin"
)

var once sync.Once

func Default(ctx context.Context, serverName string) *gin.Engine {
gin.SetMode(gin.ReleaseMode)
once.Do(func() {
gin.SetMode(gin.ReleaseMode)
})

r := gin.New()
r.Use(
Expand Down

0 comments on commit c9a31ab

Please sign in to comment.