Skip to content

Commit

Permalink
Merge pull request #197 from topfreegames/fix/scheduler-events-api-st…
Browse files Browse the repository at this point in the history
…orage-initialization

Fix: Add scheduler events storage initialization at App bootstrap
  • Loading branch information
luizmiranda7 committed Sep 15, 2021
2 parents a53139d + 2dd16ba commit 5e7ad65
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
redisinterfaces "github.com/topfreegames/extensions/redis/interfaces"
"github.com/topfreegames/extensions/router"
logininterfaces "github.com/topfreegames/maestro/login/interfaces"
storageredis "github.com/topfreegames/maestro/storage/redis"

"github.com/gorilla/mux"
opentracing "github.com/opentracing/opentracing-go"
Expand Down Expand Up @@ -455,6 +456,7 @@ func (a *App) configureApp(
a.configureWilliam()
a.configureServer()
a.configureEnvironment()
a.configureEventStorage()
return nil
}

Expand Down Expand Up @@ -505,6 +507,10 @@ func (a *App) configureCache() {
a.SchedulerCache = models.NewSchedulerCache(expirationTime, cleanupInterval, a.Logger)
}

func (a *App) configureEventStorage() {
a.SchedulerEventStorage = storageredis.NewRedisSchedulerEventStorage(a.RedisClient.Client)
}

func (a *App) configureForwarders() {
a.Forwarders = eventforwarder.LoadEventForwardersFromConfig(a.Config, a.Logger)
}
Expand Down

0 comments on commit 5e7ad65

Please sign in to comment.