From 4fa5e0f7cae8b6877b552948d22b5449c71d6f37 Mon Sep 17 00:00:00 2001 From: Clement <159793462+clementupshot@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:14:11 +0200 Subject: [PATCH] Fix update on token timestamp conflicts --- app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.py b/app.py index f8da116..959be2a 100644 --- a/app.py +++ b/app.py @@ -66,7 +66,7 @@ def update_price(token_name, token_from, token_to): # Save price into database conn = sqlite3.connect(DATABASE_PATH) cursor = conn.cursor() - cursor.execute("INSERT INTO prices (timestamp, token, price) VALUES (?, ?, ?)", (timestamp, token, price)) + cursor.execute("INSERT OR REPLACE INTO prices (timestamp, token, price) VALUES (?, ?, ?)", (timestamp, token, price)) cursor.close() cursor = conn.cursor()