Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
peterxcli committed Feb 21, 2024
1 parent 5017267 commit 4a9d534
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,14 @@ func ReverseProxy() gin.HandlerFunc {
}

func SetUpAsynqMon(app *bootstrap.Application) {
readonly := false
if app.Env.Env == bootstrap.DevelopmentEnv {
readonly = true
}
h := asynqmon.New(asynqmon.Options{
RootPath: "/monitoring", // RootPath specifies the root for asynqmon app
RedisConnOpt: asynq.RedisClientOpt{Addr: app.Cache.Options().Addr},
ReadOnly: readonly,
})

// Use Gin's Group function to create a route group with the specified prefix
Expand Down
9 changes: 9 additions & 0 deletions pkg/bootstrap/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@ import (
"github.com/caarlos0/env/v9"
)

type envType string

var (
DevelopmentEnv envType = "development"
ProductionEnv envType = "production"
StageEnv envType = "stage"
)

type Env struct {
DB DBEnv `envPrefix:"DB_"`
Redis RedisEnv `envPrefix:"REDIS_"`
Server Server `envPrefix:"SERVER_"`
JWT JWTEnv `envPrefix:"JWT_"`
Line LineEnv `envPrefix:"LINE_"`
Domain string `env:"DOMAIN"`
Env envType `env:"ENV" envDefault:"development"`
}

func NewEnv() *Env {
Expand Down

0 comments on commit 4a9d534

Please sign in to comment.