Initialize pool earlier
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2019-03-23 19:38:25 +01:00
parent 76819ac804
commit baab9e6051
Signed by: peter
GPG Key ID: 374322D56E5209E8
2 changed files with 3 additions and 4 deletions

View File

@ -111,10 +111,9 @@ func NewApp(options AppOptions) *App {
options: options,
}
app.backend = loadMemoryBackend()
app.backend = loadMemoryBackend(options.pool)
app.backend.AuthEnabled = options.AuthEnabled
app.backend.baseURL = options.BaseURL
app.backend.pool = options.pool
app.hubBackend = &hubIncomingBackend{app.backend, options.BaseURL, options.pool}

View File

@ -137,8 +137,8 @@ func (b *memoryBackend) save() {
jw.Encode(b)
}
func loadMemoryBackend() *memoryBackend {
backend := &memoryBackend{}
func loadMemoryBackend(pool *redis.Pool) *memoryBackend {
backend := &memoryBackend{pool: pool}
err := backend.load()
if err != nil {
log.Printf("Error while loadingbackend: %v\n", err)