This project is read-only.

Background task max execution time - timeout?

Topics: Core, Writing modules
Nov 3, 2012 at 8:54 PM

I'd like to run some background tasks that should do a lot of work. Now since most possibly tasks would time out if they'd do the whole work in one run (periodically) they'd time out (am I correctly assuming this?) so I'd divide the work in batches. However I'd still like the tasks to run as long as they can, not much less.

How can I achieve that? What is the maximal execution time of background tasks, or if it depends on the environment/configuration, how can I determine it? Essentially, is there a way to detect from a background task that it's running out of time?

Any help would be appreciated.

Nov 8, 2012 at 7:39 PM

Anybody with an idea?

Dec 26, 2012 at 11:09 AM

I'm sorry, I don't. Perhaps implement a Windows Service and something like a Message Queue to communicate with it.

Dec 26, 2012 at 11:52 AM

Thanks Sipke :-). BTW meanwhile Piotr told me that the timeout is determined by the NHibernate transaction's timeout.