From 8bbefff6c7a69afc4bd5f0c55e59d3f81d99e291 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Sat, 4 Mar 2017 23:18:26 +0300 Subject: [PATCH] history - travis tests fix --- toxygen/history.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toxygen/history.py b/toxygen/history.py index 5eb8647..586981a 100644 --- a/toxygen/history.py +++ b/toxygen/history.py @@ -135,11 +135,13 @@ class History: db.close() def delete_message(self, tox_id, time): + start, end = str(time - 0.01), str(time + 0.01) chdir(settings.ProfileHelper.get_path()) db = connect(self._name + '.hstr', timeout=TIMEOUT) try: 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() except: print('Database is locked!')