unlock db removed
This commit is contained in:
parent
dfab0491a5
commit
fd722f4628
@ -1,4 +1,4 @@
|
|||||||
from sqlite3 import connect, dbapi2
|
from sqlite3 import connect
|
||||||
import settings
|
import settings
|
||||||
from os import chdir
|
from os import chdir
|
||||||
import os.path
|
import os.path
|
||||||
@ -77,7 +77,6 @@ class History:
|
|||||||
db.commit()
|
db.commit()
|
||||||
except:
|
except:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
self.unlock_db()
|
|
||||||
finally:
|
finally:
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
@ -91,7 +90,6 @@ class History:
|
|||||||
db.commit()
|
db.commit()
|
||||||
except:
|
except:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
self.unlock_db()
|
|
||||||
finally:
|
finally:
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
@ -114,7 +112,6 @@ class History:
|
|||||||
db.commit()
|
db.commit()
|
||||||
except:
|
except:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
self.unlock_db()
|
|
||||||
finally:
|
finally:
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
@ -128,7 +125,6 @@ class History:
|
|||||||
db.commit()
|
db.commit()
|
||||||
except:
|
except:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
self.unlock_db()
|
|
||||||
finally:
|
finally:
|
||||||
db.close()
|
db.close()
|
||||||
pass
|
pass
|
||||||
@ -142,7 +138,6 @@ class History:
|
|||||||
db.commit()
|
db.commit()
|
||||||
except:
|
except:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
self.unlock_db()
|
|
||||||
finally:
|
finally:
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
@ -155,16 +150,9 @@ class History:
|
|||||||
db.commit()
|
db.commit()
|
||||||
except:
|
except:
|
||||||
db.rollback()
|
db.rollback()
|
||||||
self.unlock_db()
|
|
||||||
finally:
|
finally:
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
def unlock_db(self):
|
|
||||||
print('Unlocking db...')
|
|
||||||
connection = dbapi2.connect(self._name)
|
|
||||||
connection.commit()
|
|
||||||
connection.close()
|
|
||||||
|
|
||||||
def messages_getter(self, tox_id):
|
def messages_getter(self, tox_id):
|
||||||
return History.MessageGetter(self._name, tox_id)
|
return History.MessageGetter(self._name, tox_id)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user