A script that never dies!

I have this script which basically goes to a website... logs in a user and then cleans up. Repeats every 15 minutes. We expect the server to choke every hour or so which we are trying to log.

The problem is... when is does die... my script stops. I thought I had build it not to exit... just clean up and try again in 15 minutes... but apparently... I'm missing something.

How do you tell a script, "Look, no matter what happens... even if you clean up dies... try again in 15 minutes."

This is what I got...
	
repeat 1000 times
	
	Put "STARTDuplicateSMSFinder"
	
	try

Do stuff

		// Wait
		Put "Start 15 Minute Wait"
		Wait 900.00 
		
	catch
		
		// LOG 
Log stuff
		
		//  CLEAN UP
Clean up stuff
		
	end try
	
	//  CLEAN UP
Clean up stuff
	
end repeat

Comments

  • JonathanOSXJonathanOSX ForumAdmin admin
    What you have now will skip the wait when you get an exception in the "Do Stuff" part . So if you fail pretty quickly in the "Do Stuff" then it's going to burn through your 1000 tests in much less time than you might expect.

    So, if you only want to test every 15 minutes (regardless of success or failure) then move your wait after the catch block.

    Also, FYI, you can put "Wait 15 minutes" in your script directly which is a little more readible than "Wait 900.0".
Sign In or Register to comment.