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

Add retry to DB schema/tables initialization #2440

Open
joedyndale opened this issue Sep 6, 2024 · 0 comments
Open

Add retry to DB schema/tables initialization #2440

joedyndale opened this issue Sep 6, 2024 · 0 comments

Comments

@joedyndale
Copy link

joedyndale commented Sep 6, 2024

Currently, the DB schema and tables are attempted created on service start. However, there's no retries on this process. For example, when running a service using .NET Aspire, the service always fails to initialize the schema/tables and establish a connection to the DB because the database isn't quite ready yet. The logs just say something about the connection being successful, but failing on pre-handshake. If I, in the Program.cs file add a 10-second delay before configuring the IServiceCollection, the service is able to create the schema/tables and establish the connection just fine. It would be nice not to have such a delay on startup of the service, and instead have Hangfire initialization at least try a few times if a connection can't immediately be established.

.NET 8
Hangfire 1.8.14
Aspire 8.2.0
MacOS 14.6.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant