开发者

how to restart scripts automatic

开发者 https://www.devze.com 2022-12-09 16:17 出处:网络
What\'s the best way if you have a big script with a large process and you get an Error, then how to tell the scri开发者_Go百科pt, wait 1min and begin again from top.

What's the best way if you have a big script with a large process and you get an Error, then how to tell the scri开发者_Go百科pt, wait 1min and begin again from top.

It's written in asp.net, c#.

Example

protected void doAll() {

FirstFunction();
// If I get in this function an error it should stop wait 1min. and start doAll() again.

NextFunction();

// END 
}


Try the code that may cause an error inside FirstFunction(). Catch the resulting error, sleep for a minute and call doAll(). I am not sure how it is done in ASP.NET/C#.


Think about what you are saying. Do you really want the user to wait 1, 2, 3 or even more minutes for a web page to download and render on their screen?

I strongly suggest you think about some other way of handling errors in this routine. Perhaps if you explained to us why you want to wait 1 minute, we might be able to suggest a better approach.

0

精彩评论

暂无评论...
验证码 换一张
取 消