Skip to content

Commit

Permalink
Fix update on token timestamp conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
clementupshot authored Jul 11, 2024
1 parent 75a4ad6 commit 4fa5e0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4fa5e0f

Please sign in to comment.