.Net Core API timing task based System.Threading.Timer

  Encountered such a problem in the project: the need for a regular task, every five minutes to access a database look to see if there are unfinished tasks, the following is the appropriate shots, which is the core of the life cycle of the service, I'm just here record it, to prevent forgetting.

The most important thing is to create a scoped scope so that the context of the normal database access

 

Guess you like

Origin www.cnblogs.com/inttochar/p/11511508.html