Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ideas on delaying a map more than 10 seconds?

Status
Not open for further replies.

clk430

Programmer
Sep 21, 2005
235
US
I have a map that unzips files (winzip is called via a batch file/batch output adapter) and places it in a folder.

The second map picks these files up and processes them.

Unfortunately, the second map gets a 'source not available' because the winzip executable does not release the files quick enough. Retries fix this problem, but error still get genrated.

Other than a map delay of 9999, have any of you implemeted solutions to delay a map longer?

I don't want to change the entire global trigger time in the .ini just for this system.
 
Even if you'll manage to delay the second map for, say, 10 seconds, I don't think that your architecture is a good idea. Every time you use a file trigger you must be sure that the file to be processed is available COMPLETELY. And that's not possible using unzip and a file trigger. A similar problem typically exists when working with ftp: the file seems to be there already although it still is being transmitted. The typical solution for such a scenario: unzip (ftp, ...) the files to either a temporary directory or under a temporary name and then move them to the place/to the name the file trigger is set to. As you are already using a batch file, this could be achieved therein.
 
Or output a trigger file as the last card in the map. We normally output a maprun.ok file out and use thast to trigger the next process. That way we know everything has finished.
 
And make sure you have a scope of card for the card that does the batch to make sure it is commited. You need to have the -poll setting long enough so that the map will wait for the batch to complete also.

You also could add a statement at the end of the batch file that would create the trigger file if the rest of the batch file completed sucessfully. This way you won't trigger the next map if there was a problem.

This would actually be a better solution, build error handling in the batch command. Could be if statement, if good produce trigger file for next map, if bad produce trigger file containing error message for another map to process.



BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top