Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #24652

Re: retry many times decorator

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 <barber.justin@gmail.com>
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 <mailman.1628.1340960024.4697.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=71.56.112.238; posting-account=ughqpQoAAADgjLxNkFZEwHmwm6hWzMMo
References <CAF_E5JYVNQmf7yptnuarqV8=aVPaix5xQg-q9bFe3Cg8wwPNYg@mail.gmail.com> <4FEC8278.7020806@mrabarnett.plus.com> <mailman.1612.1340900799.4697.python-list@python.org> <4fec97d9$0$29978$c3e8da3$5496439d@news.astraweb.com> <4FECC890.1030202@gmail.com> <mailman.1628.1340960024.4697.python-list@python.org>
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 <barber.justin@gmail.com>
To comp.lang.python@googlegroups.com
Content-Type text/plain; charset=ISO-8859-1
Cc python-list <python-list@python.org>, Steven D'Aprano <steve+comp.lang.python@pearwood.info>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Message-ID <mailman.1629.1340973905.4697.python-list@python.org> (permalink)
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

Show key headers only | View raw


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?

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: retry many times decorator andrea crotti <andrea.crotti.0@gmail.com> - 2012-06-28 17:26 +0100
  Re: retry many times decorator Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-06-28 17:43 +0000
    Re: retry many times decorator Andrea Crotti <andrea.crotti.0@gmail.com> - 2012-06-28 22:11 +0100
    Re: retry many times decorator andrea crotti <andrea.crotti.0@gmail.com> - 2012-06-29 09:53 +0100
      Re: retry many times decorator Justin Barber <barber.justin@gmail.com> - 2012-06-29 05:45 -0700
      Re: retry many times decorator Justin Barber <barber.justin@gmail.com> - 2012-06-29 05:45 -0700

csiph-web