simplify refresh_counters
This commit is contained in:
parent
6e500c962d
commit
c68a3924fc
|
@ -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():
|
||||||
|
|
Loading…
Reference in New Issue