If the nested task does not fail, the loop must be finished. + public void execute() throws BuildException { + for(int i=0; i<=retryCount; i++) { + try { + nestedTask.perform(); + } catch (Exception e) { + if (i<retryCount) { + log("Attempt ["+i+"] error occured, retrying...", e, Project.MSG_INFO); + } else { + throw new BuildException("Task ["+nestedTask.getTaskName()+"] failed after ["+retryCount+"] attempts, giving up"); + } + } + } + }
Jan >-----Ursprüngliche Nachricht----- >Von: Kevin Jackson [mailto:[EMAIL PROTECTED] >Gesendet: Freitag, 18. Mai 2007 10:28 >An: Ant Developers List >Betreff: Retry task available in svn head > >Hi all, > >Based on the feedback, I modified the task a little (only support 1 >nested task) and threw together some doc. > >Please -1 if you think this is unsuitable/broken/smells funny > >Thanks, >Kev > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]