diff --git a/hive/indexer/notification_cache.py b/hive/indexer/notification_cache.py index 1155ca28954a1c229fcf0533350e2c0863246aec..c8592cbd6c9c2fec1bc2df31e1f88fec4daea435 100644 --- a/hive/indexer/notification_cache.py +++ b/hive/indexer/notification_cache.py @@ -84,14 +84,14 @@ class VoteNotificationCache(NotificationCache): ORDER BY hn.block_num, created_at, hn.src, hn.dst ON CONFLICT (src, dst, type_id, post_id, block_num) DO NOTHING """ + cls.beginTx() for chunk in chunks(cls.vote_notifications, 1000): - cls.beginTx() values_str = ",".join( f"({n['block_num']}, {escape_characters(n['voter'])}, {escape_characters(n['author'])}, {escape_characters(n['permlink'])}, {escape_characters(n['last_update'])}::timestamp, {n['rshares']}, {n['counter']})" for k, n in chunk.items() ) cls.db.query_prepared(sql.format(values_str)) - cls.commitTx() + cls.commitTx() else: n = 0 cls.vote_notifications.clear()