Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.027 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'errors,': 0.09; 'friday,': 0.09; 'retry': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr :python-list': 0.10; 'anyway': 0.11; 'sorts': 0.16; 'wrote:': 0.17; 'fix': 0.17; 'cc:2**1': 0.24; 'machine': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'logging': 0.27; 'restart': 0.29; 'class': 0.29; 'maybe': 0.29; 'error': 0.30; 'could': 0.32; 'received:google.com': 0.34; "won't": 0.35; 'received:209.85': 0.35; 'there': 0.35; 'ability': 0.36; 'method': 0.36; 'anything': 0.36; 'should': 0.36; 'problems': 0.36; 'rather': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'think': 0.40; 'your': 0.60; 'sounds': 0.71; 'hand': 0.82; 'andrea': 0.84; 'subject:times': 0.84 Newsgroups: comp.lang.python Date: Fri, 29 Jun 2012 05:45:02 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.56.112.238; posting-account=ughqpQoAAADgjLxNkFZEwHmwm6hWzMMo References: <4FEC8278.7020806@mrabarnett.plus.com> <4fec97d9$0$29978$c3e8da3$5496439d@news.astraweb.com> <4FECC890.1030202@gmail.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 71.56.112.238 MIME-Version: 1.0 Subject: Re: retry many times decorator From: Justin Barber To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list , Steven D'Aprano X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1340973905 news.xs4all.nl 6945 [2001:888:2000:d::a6]:37504 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:24652 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 someone will fix MySql it would > restart again without human intervention. > > So I think I could even just let it retry and use maybe a SMTPHanlder > for the logging errors, to make the notification of problems very > quick.. Rather then write a decorator, sounds like you should write your own class or method connecting to the database that has the ability to retry. Are you finding you are decorating only db calls or are you decorating all sorts of stuff?