Made filters inclusive of start and end times

This was a bug that I introduced in my review of @Andrei-Dolgolev's
changes.
pull/286/head
Neeraj Kashyap 2021-10-08 05:36:25 -07:00
rodzic 4b41b4cb38
commit a2ea96b35e
1 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -445,20 +445,20 @@ def filter_data(
"""
cur = sqlite_db.cursor()
print(f"Remove by timestamp <= {start_time}")
print(f"Remove by timestamp < {start_time}")
if start_time:
cur.execute(f"DELETE from transfers where timestamp <= {start_time}")
cur.execute(f"DELETE from transfers where timestamp < {start_time}")
print(f"Transfers filtered out: {cur.rowcount}")
sqlite_db.commit()
cur.execute(f"DELETE from mints where timestamp <= {start_time}")
cur.execute(f"DELETE from mints where timestamp < {start_time}")
print(f"Mints filtered out: {cur.rowcount}")
sqlite_db.commit()
print(f"Remove by timestamp >= {end_time}")
print(f"Remove by timestamp > {end_time}")
if end_time:
cur.execute(f"DELETE from transfers where timestamp >= {end_time}")
cur.execute(f"DELETE from transfers where timestamp > {end_time}")
print(f"Transfers filtered out: {cur.rowcount}")
sqlite_db.commit()
cur.execute(f"DELETE from mints where timestamp >= {end_time}")
cur.execute(f"DELETE from mints where timestamp > {end_time}")
print(f"Mints filtered out: {cur.rowcount}")
sqlite_db.commit()