mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
flake8 fix
This commit is contained in:
parent
5550e0986e
commit
0cb327819d
@ -43,14 +43,14 @@ class RethinkDBConnection(Connection):
|
|||||||
# NOTE: fix for timeout not initialized on rethinkdb connection
|
# NOTE: fix for timeout not initialized on rethinkdb connection
|
||||||
# https://github.com/bigchaindb/bigchaindb/issues/1337
|
# https://github.com/bigchaindb/bigchaindb/issues/1337
|
||||||
|
|
||||||
connected=False
|
connected = False
|
||||||
dbconf = bigchaindb.config['database']
|
dbconf = bigchaindb.config['database']
|
||||||
timeout = dbconf['connection_timeout']
|
timeout = dbconf['connection_timeout']
|
||||||
end_time = time.time()*1000 + timeout
|
end_time = time.time()*1000 + timeout
|
||||||
while not connected:
|
while not connected:
|
||||||
try:
|
try:
|
||||||
rconn=r.connect(host=self.host, port=self.port, db=self.dbname)
|
rconn = r.connect(host=self.host, port=self.port, db=self.dbname)
|
||||||
connected=True
|
connected = True
|
||||||
except r.ReqlDriverError as exc:
|
except r.ReqlDriverError as exc:
|
||||||
if time.time()*1000 > end_time:
|
if time.time()*1000 > end_time:
|
||||||
raise ConnectionError from exc
|
raise ConnectionError from exc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user