Anti-skid filling

I am new to hangfire and am looking for a solution that can solve the case below

  • take the data from the database and convert it to a CSV file. this should happen when the user inserts a new record, hangfire should fire at the end of the day if a new record is inserted.
  • Can we deploy hangfire on the local computer and do the testing
0
source share
1 answer

take data from the database and convert it to a CSV file

You can use hangfire to run any public method in any class of your application. Therefore, if you write a method that does what you want, then hangfire can call this method:

BackgroundJob.Enqueue<IUserRecordProcessor>(x => x.ProcessRecord()); 

hangfire should skip the end of the day if a new entry is inserted into it.

You can schedule a hangfire to perform repetitive tasks (see here ). However, this implementation is not conditional. Instead, you should move the conditional logic into code that causes a hang:

 RecurringJob.AddOrUpdate<IUserRecordProcessor>(x => x.ProcessRecordIfOneExists(), Cron.Daily); 

Can we deploy hangfire on the local computer and do the testing

Yes, you can.

+1
source

Source: https://habr.com/ru/post/1243582/


All Articles