1

Topic: asp.net web api falls asleep

Hello. Postoe application asp.net web api. In Global.asax.cs works Task which time 5 minutes something does. E.g. loads pictures from other servers. Task. Factory. StartNew (() => {while (true) {LoadImages (); Thread. Sleep (5*60*1000);}}); if to services long not to address (not to cause any of methods of Controllers), application simply falls asleep and Task ceases to work each 5 mines. How it can be solved?

2

Re: asp.net web api falls asleep

Hello, #John, you wrote: J> If to services long not to address (not to cause any of methods of Controllers), application simply falls asleep and Task ceases to work each 5 mines. J> As it can be solved? It  in adjustments iis

3

Re: asp.net web api falls asleep

Hello, #John, you wrote: J> As it can be solved? As already told - in pool adjustments. But as a whole idea to launch long-playing tasks in  asp.net not the most successful idea.  can die on a heap of the different reasons. The correct method of the decision of similar tasks - separate process and   queue between this process and the web application. In  it is possible still with WebJobs to experiment, but there yet all is fine.... <<RSDN@Home 1.0.0 alpha 5 rev. 0 on Windows 8 6.2.9200.0>>

4

Re: asp.net web api falls asleep

Hello, Jack128, you wrote: J> It  in adjustments iis Adjusted, like all should work, but is not present. As the fast decision in windows tasks added ::go curl http://localhost/api/ timeout 600 goto go

5

Re: asp.net web api falls asleep

Hello, #John, you wrote: J> As it can be solved? https://www.hangfire.io/overview.html

6

Re: asp.net web api falls asleep

J> J> Task. Factory. StartNew (() => {J> while (true) J> {J> LoadImages (); J> Thread. Sleep (5*60*1000); J>} J>}); J> J> If to services long not to address (not to cause any of methods of Controllers), application simply falls asleep and Task ceases to work each 5 mines. J> As it can be solved? Probably, helps IRegisteredObject as it is described in article: https://haacked.com/archive/2011/10/16/ … -net.aspx/