Amazing! I am trying to deploy this type of project, but I am encountering a dependency error in IIS, such as 'does not contain a method with the signature.
Do you have enabled logging to check in which place actually it throw that Exception? It’s the InvalidOperationException. Does it work while running locally?
Bro, very useful video, thanks. I need to display the ScheduledAt and NextExecution fields on the frontend. However, to calculate NextExecution, I need the Cron property. How or where can I obtain it? In my code, I do the following: csharp var jobs = StorageConnection.ScheduledJobs(0, 100).Select(j => new { j.Value, j.Key }); But the jobs variable does not have the Cron property.
If you have set the trigger for the job then you can obtain it like: var scheduledTime = await scheduler.GetTrigger(new TriggerKey("myTrigger", "group1")).Result.GetPreviousFireTimeUtc(); var nextExecutionTime = await scheduler.GetTrigger(new TriggerKey("myTrigger", "group1")).Result.GetNextFireTimeUtc();
Hangfire server is the consumer of the requested job to be done by the producer. When you use for instance Enqueue method it will be stored in the database and later on based on the configuration the Hangfire server will process this job accordingly. This is the good approach of decoupling the producer/consumer which then could be scaled out if needed
It’s related with „producing” emails and this is the only reason for that. Anyway it is registered only in Server side, so without any issues it could be situated as well in Server project 😉
Great video! A lot of useful knowledge!
Thanks Natalia 🎉
Amazing keep up the good work !
Amazing! I am trying to deploy this type of project, but I am encountering a dependency error in IIS, such as 'does not contain a method with the signature.
Do you have enabled logging to check in which place actually it throw that Exception? It’s the InvalidOperationException. Does it work while running locally?
This video helps me alot thanks
Great video, congratulation, I have one question, wht IDE are you using to coding?
Thanks 😁 I use Rider IDE
Bro, very useful video, thanks.
I need to display the ScheduledAt and NextExecution fields on the frontend. However, to calculate NextExecution, I need the Cron property. How or where can I obtain it?
In my code, I do the following:
csharp
var jobs = StorageConnection.ScheduledJobs(0, 100).Select(j => new { j.Value, j.Key });
But the jobs variable does not have the Cron property.
If you have set the trigger for the job then you can obtain it like:
var scheduledTime = await scheduler.GetTrigger(new TriggerKey("myTrigger", "group1")).Result.GetPreviousFireTimeUtc();
var nextExecutionTime = await scheduler.GetTrigger(new TriggerKey("myTrigger", "group1")).Result.GetNextFireTimeUtc();
thanks
Why you have created separate projects for hangfire server and running it willingly? Doesn't hangfire servers run continuosuly?
Hangfire server is the consumer of the requested job to be done by the producer. When you use for instance Enqueue method it will be stored in the database and later on based on the configuration the Hangfire server will process this job accordingly. This is the good approach of decoupling the producer/consumer which then could be scaled out if needed
Why EmailService is in Producer project instead of Hangfire server?
It’s related with „producing” emails and this is the only reason for that. Anyway it is registered only in Server side, so without any issues it could be situated as well in Server project 😉
Mine does not execute. Can you help out?
Of course, why exactly it did not execute? Do you have maybe an exception with stacktrace?
Where is code ?
It will be updated soon to the GitHub repository 😊