Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

        def exp_backoff(func, args=(), kw={}, max_repeat=10, start_backoff_sec=2,
        exceptions=(Exception,), ignore_exceptions=tuple()):
    n = 0
    while True:
        try:
            result = func(*args, **kw)
        except ignore_exceptions:
            time.sleep(0.01)
        except exceptions, ex:
            if (n+1) >= max_repeat:
                raise
            wait_for = start_backoff_sec * 2**n
            print >>sys.stderr, ("An error occured. Retry in %d seconds: %r" %
                (wait_for, ex))
            time.sleep(wait_for)
            n += 1
        else:
            return result
        


src/m/a/MapProxy-1.6.0/mapproxy/seed/seeder.py   MapProxy(Download)
from mapproxy.seed.cachelock import DummyCacheLocker, CacheLockedError
 
from mapproxy.seed.util import (exp_backoff, ETA, limit_sub_bbox,
    status_symbol)
 
                return
            with self.tile_mgr.session():
                exp_backoff(self.tile_mgr.load_tile_coords, args=(tiles,),
                        exceptions=(SourceError, IOError), ignore_exceptions=(LockTimeout, ))
 

src/m/a/mapproxy-HEAD/mapproxy/seed/seeder.py   mapproxy(Download)
from mapproxy.seed.cachelock import DummyCacheLocker, CacheLockedError
 
from mapproxy.seed.util import (exp_backoff, ETA, limit_sub_bbox,
    status_symbol)
 
                return
            with self.tile_mgr.session():
                exp_backoff(self.tile_mgr.load_tile_coords, args=(tiles,),
                        exceptions=(SourceError, IOError), ignore_exceptions=(LockTimeout, ))