mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
Merge branch 'master' into fixes-no-unique-service-after-nomination
This commit is contained in:
commit
5fbedb0443
@ -8,6 +8,10 @@ python:
|
||||
- nightly
|
||||
- pypy
|
||||
- pypy3
|
||||
matrix:
|
||||
allow_failures:
|
||||
- python: nightly
|
||||
- python: 3.7-dev
|
||||
services:
|
||||
- docker
|
||||
before_install:
|
||||
|
Binary file not shown.
@ -21,6 +21,7 @@ import logging
|
||||
import random
|
||||
import time
|
||||
import types
|
||||
import re
|
||||
|
||||
class RethinkerWrapper(object):
|
||||
logger = logging.getLogger('doublethink.RethinkerWrapper')
|
||||
@ -66,6 +67,16 @@ class RethinkerWrapper(object):
|
||||
return result
|
||||
except r.ReqlTimeoutError as e:
|
||||
time.sleep(0.5)
|
||||
except r.ReqlOpFailedError as e:
|
||||
if e.args and re.match(
|
||||
'^Cannot perform.*primary replica.*',
|
||||
e.args[0]):
|
||||
self.logger.error(
|
||||
'will keep trying after potentially recoverable '
|
||||
'error: %s', e)
|
||||
time.sleep(0.5)
|
||||
else:
|
||||
raise
|
||||
finally:
|
||||
if not is_iter:
|
||||
conn.close(noreply_wait=False)
|
||||
|
Loading…
x
Reference in New Issue
Block a user