refactor: Fix linter errors
This commit is contained in:
@@ -75,8 +75,7 @@ func (c *Connection) listenCloseNotify() {
|
||||
))
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-c.closeNotify:
|
||||
<-c.closeNotify
|
||||
c.logger.Info("Trying to reconnect to rabbit")
|
||||
|
||||
dial, dialErr := amqp.Dial(c.connString)
|
||||
@@ -91,9 +90,6 @@ func (c *Connection) listenCloseNotify() {
|
||||
|
||||
c.logger.Info("Rabbit connection stabilized")
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
time.Sleep(c.reconnectInterval)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,12 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type ContextKey string
|
||||
|
||||
const (
|
||||
UserContextKey ContextKey = "user"
|
||||
)
|
||||
|
||||
func SetUserFromJWT() gin.HandlerFunc {
|
||||
return func(c *gin.Context) {
|
||||
ctx := c.Request.Context()
|
||||
@@ -34,7 +40,7 @@ func SetUserFromJWT() gin.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
ctx = context.WithValue(ctx, "user", user)
|
||||
ctx = context.WithValue(ctx, UserContextKey, user)
|
||||
|
||||
c.Request = c.Request.WithContext(ctx)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user