nopSolutions / nopCommerce

ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
https://www.nopcommerce.com
Other
9.09k stars 5.2k forks source link

Schedule tasks. Use async timer #7189

Closed ksbhadani closed 1 month ago

ksbhadani commented 2 months ago

nopCommerce version: > 4.5

Steps to reproduce the problem:

Schedule tasks are made async but there caller stacks are sync and that leads to threadpool starvation, refer below screen shots

TaskThread

image

I think we should use periodic timer here, so that it can use async methods https://learn.microsoft.com/en-us/dotnet/api/system.threading.periodictimer?view=net-8.0

ScheduleTaskRunner image

We should use async methods

skoshelev commented 1 month ago

Closed #7189