If my code has infinite loop or Thread.Sleep(999999999), executionTimeout and AsyncTimeout value(10s) has no effect. So, how to stop infinite loop in asp.net mvc, throw timeout exception and request is finish?
Asked
Active
Viewed 320 times
2
-
1why would your code have an infinite loop ? isn't better to add some validation to prevent it in the first place? – Gonzalo.- Mar 06 '17 at 02:46
-
start a timer quick before execution of for loop. Check timer value in each iteration and set timeout to true after the time you need to stop – Pawan Mar 06 '17 at 06:10