From 82f2ad21e1c39e0ad0d493a00938c4d8c4dc4976 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Fri, 28 Jun 2019 16:02:54 -0400 Subject: [PATCH] added IGNORE to insert into trend query --- lbry/lbry/wallet/server/trending.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbry/lbry/wallet/server/trending.py b/lbry/lbry/wallet/server/trending.py index 6b5e85bcf..650854174 100644 --- a/lbry/lbry/wallet/server/trending.py +++ b/lbry/lbry/wallet/server/trending.py @@ -61,7 +61,7 @@ def calculate_trending(db, height, is_first_sync, final_height): start = (height-TRENDING_WINDOW)+1 db.execute(f""" - INSERT INTO trend (claim_hash, height, amount) + INSERT OR IGNORE INTO trend (claim_hash, height, amount) SELECT claim_hash, {start}, COALESCE( (SELECT SUM(amount) FROM support WHERE claim_hash=claim.claim_hash AND height >= {start}), 0