history - travis tests fix
This commit is contained in:
parent
019165aeac
commit
8bbefff6c7
1 changed files with 3 additions and 1 deletions
|
@ -135,11 +135,13 @@ class History:
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
def delete_message(self, tox_id, time):
|
def delete_message(self, tox_id, time):
|
||||||
|
start, end = str(time - 0.01), str(time + 0.01)
|
||||||
chdir(settings.ProfileHelper.get_path())
|
chdir(settings.ProfileHelper.get_path())
|
||||||
db = connect(self._name + '.hstr', timeout=TIMEOUT)
|
db = connect(self._name + '.hstr', timeout=TIMEOUT)
|
||||||
try:
|
try:
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
cursor.execute('DELETE FROM id' + tox_id + ' WHERE unix_time = ' + str(time) + ';')
|
cursor.execute('DELETE FROM id' + tox_id + ' WHERE unix_time < ' + end + ' AND unix_time > ' +
|
||||||
|
start + ';')
|
||||||
db.commit()
|
db.commit()
|
||||||
except:
|
except:
|
||||||
print('Database is locked!')
|
print('Database is locked!')
|
||||||
|
|
Loading…
Reference in a new issue