Skip to content

Commit

Permalink
Initialize pool earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
pstuifzand committed Mar 23, 2019
1 parent 76819ac commit baab9e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions cmd/eksterd/main.go
Expand Up @@ -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}

Expand Down
4 changes: 2 additions & 2 deletions cmd/eksterd/memory.go
Expand Up @@ -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)
Expand Down

0 comments on commit baab9e6

Please sign in to comment.