Skip to content

Commit

Permalink
Fix (global.db): Test consistency with updates
Browse files Browse the repository at this point in the history
Signed-off-by: OjusWiZard <ojuswimail@gmail.com>
  • Loading branch information
OjusWiZard committed May 20, 2024
1 parent 28ceb69 commit c4fa5ed
Show file tree
Hide file tree
Showing 3 changed files with 345 additions and 3 deletions.
Binary file modified rotkehlchen/data/global.db
Binary file not shown.
6 changes: 6 additions & 0 deletions rotkehlchen/globaldb/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,12 @@ def _handle_asset_update(

try:
with connection.savepoint_ctx() as cursor:
if action.startswith('UPDATE') and cursor.execute(
'SELECT COUNT(*) FROM assets WHERE identifier=?',
(remote_asset_data.identifier,),
).fetchone()[0] == 0:
executeall(cursor, full_insert)

executeall(cursor, action)
if local_asset is not None:
AssetResolver().clean_memory_cache(identifier=local_asset.identifier)
Expand Down
Loading

0 comments on commit c4fa5ed

Please sign in to comment.