simplify refresh_counters

This commit is contained in:
Lili (Tlapka) 2023-03-27 14:19:26 +02:00
parent 6e500c962d
commit c68a3924fc
1 changed files with 1 additions and 11 deletions

View File

@ -68,17 +68,7 @@ def refresh_counters():
db.commit() db.commit()
except sqlite3.Error as e: except sqlite3.Error as e:
print("Error occured deleting old counters:", e.args[0]) print("Error occured deleting old counters:", e.args[0])
insert_counters(db)
for redeem, redeem_info in current_app.config['REDEEMS'].items():
if redeem_info["type"] == "counter":
try:
cursor = db.execute(
"INSERT INTO counters(name, count) VALUES(?, 0)",
(redeem,)
)
db.commit()
except sqlite3.Error as e:
print("Failed inserting counters to db:", e.args[0])
def refresh_milestones(): def refresh_milestones():