Comments (4)
Ok it seems that migration couldn't be applied. Retries were invoked resulting in final message:
(Hangfire.SqlServer.SqlServerObjectsInstaller) Was unable to perform the Hangfire schema migration due to an exception. Ignore this message unless you've just installed or upgraded Hangfire.
Can I somehow manually invoke migration or perhaps increase the retries?
from hangfire.
Ended up writing my own runner which tries to perform installation and adding the jobs
IScheduledJobsStartupBootstrapper just bundels all those AddOrUpdate calls in one spot in some other assembly
public sealed class ScheduledJobsStartupRunner(
IScheduledJobsStartupBootstrapper bootstrapper,
SqlServerConnectionString connectionString,
ILogger<ScheduledJobsStartupRunner> logger
) : BackgroundService
{
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
while (!stoppingToken.IsCancellationRequested)
{
try
{
SqlServerObjectsInstaller.Install(new SqlConnection(connectionString));
bootstrapper.AddScheduledJobs();
logger.LogInformation("Startup scheduled jobs added successfully!");
break;
}
catch (Exception e)
{
logger.LogDebug(e, "Something went wrong bootstrapping scheduled jobs");
logger.LogWarning("Could not bootstrap scheduled jobs, retrying");
await Task.WhenAny(Task.Delay(TimeSpan.FromSeconds(5), stoppingToken));
}
}
}
}
from hangfire.
Ok it seems that migration couldn't be applied. Retries were invoked resulting in final message:
Hm, do you have any ideas what was the exception? It should be logged if logging template includes exceptions.
from hangfire.
Ok it seems that migration couldn't be applied. Retries were invoked resulting in final message:
Hm, do you have any ideas what was the exception? It should be logged if logging template includes exceptions.
Yes, database wasn't available for some time and retries reached threshold. Eventually the db was up, but the service couldn't recover from it.
I've added resilient initializer to migrate db and add jobs that start from application startup life
from hangfire.
Related Issues (20)
- Change storage at runtime
- Time Zone East UTC-3 - Error in Servers Page
- ServiceLocator.Current.GetInstance<T> return null
- InsertToList() performance HOT 2
- Background job unable to be queued
- Problem with IReccuringJob implementation
- Hangfire Dashboard authorization is not working in .NET Core HOT 2
- why
- .NET 8 Application Dequeues Recurring Jobs without Hangfire Configuration
- Hangfire InMemory 0.9.0 Object disposed exception HOT 3
- Mixing .NET Framework and .NET Core HOT 7
- Jobs are picked up from queues that the server is not supposed to listen to
- Hangfire UI - redirect_uri is http instead of https
- Why hangfire not use meter for metrics
- Hangfire big overhead / delay by scheduling jobs HOT 1
- Sql DeadLocks HOT 1
- Hide Expired Jobs in Dasboard UI
- Hangfire with Aspire integration HOT 2
- AsyncLocal<T> retains values on every job run HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hangfire.