Add HangfireMediatorBridge and use it in generate- and delete-randombrandrequest
This is more like a POC for using mediator and hangfire together.
Not sure if the generate- and delete-brandrequest are a good example for this, but it was the fastest I could come up with... just transformed the BrandGeneratorJob into 2 different IRequests (which live in application) and their respective handlers (which live in infrastructure... but might as well live in application if they don't use hanfire specific stuff.
This is just a start... we can probably abstract the other important hangfire stuff away (like what's available on PerformingContext, and that IProgressBarFactory) so that can maybe also be used from application.
It also works for recurring jobs. As an example, I've changed the DeleteRandomBrands to actually add a recurring job that runs every minute. Just as an example... you have to remove the recurringjob manually again after testing ;-)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
In the scenario where a recurring job must be created in each and every one of the tenants, should it be established similar to the seeds?
Case of use: You must send an email to all customers pending payment. and this effect must happen every day at 12:00 pm in each of the tenants
I would think this is something that the tenant (user) himself can configure and enable/disable according to his needs. So I don't think this is something that should happen at startup, but rather when the user enables that particular functionality in the ui somewhere. At that point you then schedule a recurring job for that specific tenant and maybe other parameters for that job.
But not always the client will have knowledge of tasks or other processes of periodic execution, it is perhaps a point in favor of its initial parameterization when each tenant is created and must manually program each of the Jobs
this scenario you still need have some web request to start / initiate the scheduled job and then it will continue on using those job parameters correct?
this scenario you still need have some web request to start / initiate the scheduled job and then it will continue on using those job parameters correct?
Yes indeed, a specific user of a specific tenant is supposed to "activate" the job in some way... In my case that happens when saving a specific entity (a "job" entity which describes when a job needs to run and what exactly has to be done).
Ok, makes sense. Thanks for sharing this
From: fretje @.> Sent: Wednesday, November 30, 2022 12:27:33 PM To: fullstackhero/dotnet-webapi-boilerplate @.> Cc: Soltesz, Danny @.>; Comment @.> Subject: Re: [fullstackhero/dotnet-webapi-boilerplate] Add HangfireMediatorBridge and use it in generate- and delete-randombrandrequest (PR #572)
[CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe]
this scenario you still need have some web request to start / initiate the scheduled job and then it will continue on using those job parameters correct?
Yes indeed, a specific user of a specific tenant is supposed to "activate" the job in some way... In my case that happens when saving a specific entity (a "job" entity which describes when a job needs to run and what exactly has to be done).
— Reply to this email directly, view it on GitHubhttps://protect-us.mimecast.com/s/8pwZC4xqo0t6ABAiOMP5L?domain=github.com, or unsubscribehttps://protect-us.mimecast.com/s/jez3C5yrpGHRYZYuObAps?domain=github.com. You are receiving this because you commented.Message ID: @.***>