Restart frontend if there are DB lock errors
parent
9fa6cde752
commit
c982de4b7f
6
db.py
6
db.py
|
@ -1,7 +1,7 @@
|
|||
from config import config
|
||||
import jwt
|
||||
import logging
|
||||
from os import urandom
|
||||
from os import urandom, sleep, system
|
||||
from pylibscrypt import scrypt_mcf
|
||||
import sqlite3
|
||||
|
||||
|
@ -19,6 +19,10 @@ class DB(object):
|
|||
return self.cur.execute(*args, **kwargs)
|
||||
|
||||
def commit(self):
|
||||
try:
|
||||
self.conn.commit()
|
||||
except sqlite3.sqlite3.OperationalError:
|
||||
system("rcctl restart frontend_daemon")
|
||||
self.conn.commit()
|
||||
|
||||
def close(self):
|
||||
|
|
Loading…
Reference in New Issue