home » zplus/freepost.git
Author zPlus <zplus@peers.community> 2018-07-22 07:42:14
Committer zPlus <zplus@peers.community> 2018-07-22 07:42:14
Commit c822d3e (patch)
Tree 50a089d
Parent(s)

Fix database timeout issue. modified: freepost/database.py


commits diff: e2d139c..c822d3e
1 file changed, 4 insertions, 0 deletionsdownload


Diffstat
-rw-r--r-- freepost/database.py 4

Diff options
View
Side
Whitespace
Context lines
Inter-hunk lines
+4/-0 M   freepost/database.py
index c0ab7f9..bedc247
old size: 18K - new size: 18K
@@ -10,6 +10,10 @@ db = MySQLdb.connect (
10 10 passwd = settings['mysql']['password'],
11 11 autocommit = True)
12 12
13 + # Since the "db" object is reused for the entire life of website,
14 + # this ping should avoid MySQL timing out if no requests are sent in a while.
15 + db.ping (True)
16 +
13 17 # Store a new session_id for a user that has logged in
14 18 # The session token is stored in the user cookies during login, here
15 19 # we store the hash value of that token.