ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <>
Subject Re: Weird parallel/for situation
Date Wed, 29 Apr 2009 22:02:37 GMT
Could you use the <waitfor> task? This is  meant specifically to be
used with the <parallel> task. You can specify what to wait for before
continuing. For example, when the server starts up, it could create a
file that the <waitfor> task looks for before continuing.

You can use the waitfor to wait for the server URL to return a valid
return code. I've done that before. Something like this after you
start up all of your servers via the <foreach> task:

<foreach ..../>

<waitfor maxwait="1" maxwaitunit="minute">
    <equals arg1="1" arg2="2"/>

     <waitfor maxwait="30" maxwaitunit="minute">
         <http url="${SERVER_URL}"/>

<waitfor maxwait="30" maxwaitunit="second">
    <equal arg1="1" arg2="2"/>

The first <waitfor> simply waits for a minute before continuing. You
need to specify a condition, so I simply specify a condition that can
never be met. The last one simply waits 30 seconds before continuing.

On Wed, Apr 29, 2009 at 4:59 PM, fnord <> wrote:
> I've got a situation that I'm trying to script around, and I'm somewhat
> stumped, and hoping someone might have a solution.
> I have an array of servers, prod1, prod2, prod3, and prod4.
> I'm using a foreach to call restarts of them. Using the parallel parameter,
> this is blazing fast, which is great.
> The problem is that I need to pause after the first restart to make sure
> that the application came up properly, then pause for 30 seconds after each
> of the rest.
> What I'd like to do is put an "<input>Hit enter when you would like to
> continue</input>" after each of the restarts, but these just end up as part
> of the parallel tasks, which all run at the same time, then it waits for me
> to hit enter 4 times before completing.
> Any thoughts on how to implement this? The first pause could be a long time,
> and each of the later ones will be around 30 seconds, as we wait for the
> load balancer to notice that http is not responding on the host.  So having
> an <input> task would be ideal, but I just can't sort a way to get it to
> work.
> thanks,
> fnord
> --
> View this message in context:
> Sent from the Ant - Users mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

David Weintraub

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message