I'm wondering what is more suitable solution. I need to implement robot for checking and deleting unconfirmed registered users for e.g. 7 days after confirmation mail was sent. (If a user doesn't confirm his/her account I want to delete the user from database). I thought about 3 ways:
- implement a delegate in ASP NET core app directly and run it as an async task in a loop with a 24 hr sleep.
- create a console app which will run in loop with a 24 hr sleep
- create a console app which will be started by a third party software regularly (for example Cron or TaskScheduler)
Which of these ways will have the least impact for CPU and memory usage?
Also thread pool has limited amount to take, the more robots, the less threads for people trying to access my ASP net site, am I correct?
And my last question > is it a good idea to Thread.Sleep for such a long time? Something tells me it really isn't. On the other hand it's an ASP which will be running for months maybe years.
Anyway I love the vision of having all in one app (can be configured within one file and all starts at once). On the other hand something tells me it's not a super-great idea.