You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The job just pings the aggregate. And the whole process repeats.
classPingJob:IJob{publicrequiredTestIdTestId{get;init;}publicasyncTaskExecuteAsync(IServiceProviderserviceProvider,CancellationTokencancellationToken){Console.WriteLine("Job started at: {0}",DateTimeOffset.Now);awaitserviceProvider.GetRequiredService<IAggregateStore>().UpdateAsync<Test,TestId>(TestId,TestId.New,(a,_)=>a.Ping(),cancellationToken);}}
Thanks for reporting @alexeyfv. Sorry, have been travelling with work and had loads of stuff to do.
Regarding issue 1) I expect that is how Hangfire does it, you can't expect database scheduled jobs to start within seconds. Within roughly one minute is normal (as I remember it).
Regarding issue 2) I haven't seen this before and based on how the registrations work, it shouldn't. If you can reproduce it in a test added via a PR, then it would make it easier to collaborate on. Just to make sure that there aren't any other factors affecting it.
Hi,
I think I found two potential issues in the jobs functionality. But maybe I don’t understand something. Please let me know if I’m wrong.
Code snippets
There is a test aggregate.
There is also a subscriber to
Pinged
event. The subscriber schedules a job with 5 sec delay.The job just pings the aggregate. And the whole process repeats.
Full example is here.
1st issue
From the code above, I expect that the job will be started after 5 sec delay. But in my case, it starts only after 15 sec.
2nd issue
Everything works fine, if I register events, subscribers and jobs like this
But if I replace the code above with the following code:
The output becomes like this:
Seems like this causes registration of the async subscriber twice.
The text was updated successfully, but these errors were encountered: