Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve PG database initialization errors #118

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions backends/postgres/postgres_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func Backend(ctx context.Context, opts ...neoq.ConfigOption) (pb neoq.Neoq, err

err = p.initializeDB()
if err != nil {
return
return nil, fmt.Errorf("unable to initialize jobs database: %w", err)
}

if p.pool == nil { //nolint: nestif
Expand Down Expand Up @@ -175,13 +175,14 @@ func Backend(ctx context.Context, opts ...neoq.ConfigOption) (pb neoq.Neoq, err

p.pool, err = pgxpool.NewWithConfig(ctx, poolConfig)
if err != nil {
return
return nil, fmt.Errorf("unable to create worker connection pool: %w", err)
}
}

p.listenerConn, err = p.newListenerConn(ctx)
if err != nil {
p.logger.Error("unable to initialize listener connection", slog.Any("error", err))
return nil, fmt.Errorf("unable to create neoq listener connection: %w", err)
}

// monitor handlers for changes and LISTEN when new queues are added
Expand Down
Loading