Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
b61ee7f1
Commit
b61ee7f1
authored
Mar 13, 2017
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mysql: do not flood logs when retrying to connect non-stop
parent
ed966e80
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
neo/storage/database/mysqldb.py
neo/storage/database/mysqldb.py
+10
-3
No files found.
neo/storage/database/mysqldb.py
View file @
b61ee7f1
...
@@ -80,14 +80,21 @@ class MySQLDatabaseManager(DatabaseManager):
...
@@ -80,14 +80,21 @@ class MySQLDatabaseManager(DatabaseManager):
timeout_at
=
None
timeout_at
=
None
else
:
else
:
timeout_at
=
time
.
time
()
+
self
.
_wait
timeout_at
=
time
.
time
()
+
self
.
_wait
last
=
None
while
True
:
while
True
:
try
:
try
:
self
.
conn
=
MySQLdb
.
connect
(
**
kwd
)
self
.
conn
=
MySQLdb
.
connect
(
**
kwd
)
break
break
except
Exception
:
except
Exception
as
e
:
if
timeout_at
is
not
None
and
time
.
time
()
>=
timeout_at
:
if
None
is
not
timeout_at
<=
time
.
time
()
:
raise
raise
logging
.
exception
(
'Connection to MySQL failed, retrying.'
)
e
=
str
(
e
)
if
last
==
e
:
log
=
logging
.
debug
else
:
last
=
e
log
=
logging
.
exception
log
(
'Connection to MySQL failed, retrying.'
)
time
.
sleep
(
1
)
time
.
sleep
(
1
)
self
.
_active
=
0
self
.
_active
=
0
self
.
_config
=
{}
self
.
_config
=
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment