Re: retry many times decorator

2012-06-29 Thread andrea crotti
On the other hand now that I think again even supposing there is a permanent error like MySql completely down, retrying continuosly won't do any harm anyway because the machine will not be able to do anything else anyway, when someone will fix MySql it would restart again without human

Re: retry many times decorator

2012-06-29 Thread Justin Barber
On Friday, June 29, 2012 4:53:43 AM UTC-4, andrea crotti wrote: On the other hand now that I think again even supposing there is a permanent error like MySql completely down, retrying continuosly won't do any harm anyway because the machine will not be able to do anything else anyway, when

retry many times decorator

2012-06-28 Thread andrea crotti
Hi everyone, I'm replacing a perl system that has to work a lot with databases and perforce (and a few other things). This script have to run completely unsupervisioned, so it's important that it doesn't just quit at the first attempt waiting for human intervent.. They say that the network

Re: retry many times decorator

2012-06-28 Thread MRAB
On 28/06/2012 16:28, andrea crotti wrote: Hi everyone, I'm replacing a perl system that has to work a lot with databases and perforce (and a few other things). This script have to run completely unsupervisioned, so it's important that it doesn't just quit at the first attempt waiting for human

Re: retry many times decorator

2012-06-28 Thread andrea crotti
Returning a boolean isn't very Pythonic. It would be better, IMHO, if it could swallow a specified exception (or specified exceptions?) raised when an attempt failed, up to the maximum permitted number of attempts. If the final attempt fails, propagate the exception. --

Re: retry many times decorator

2012-06-28 Thread Steven D'Aprano
On Thu, 28 Jun 2012 17:26:36 +0100, andrea crotti wrote: Returning a boolean isn't very Pythonic. It would be better, IMHO, if it could swallow a specified exception (or specified exceptions?) raised when an attempt failed, up to the maximum permitted number of attempts. If the final attempt

Re: retry many times decorator

2012-06-28 Thread Andrea Crotti
On 06/28/2012 06:43 PM, Steven D'Aprano wrote: On Thu, 28 Jun 2012 17:26:36 +0100, andrea crotti wrote: I disagree. If you make a coding error in your function, why do you think it is useful to retry that buggy code over and over again? It's never going to get less buggy unless you see the