mirror of
https://github.com/elisiariocouto/leggen.git
synced 2025-12-14 13:12:22 +00:00
fix(sync): Continue on account deactivation.
This commit is contained in:
@@ -41,6 +41,7 @@ def sync(ctx: click.Context):
|
||||
info(f"Syncing balances for {len(accounts)} accounts")
|
||||
|
||||
for account in accounts:
|
||||
try:
|
||||
account_details = get(ctx, f"/accounts/{account}")
|
||||
account_balances = get(ctx, f"/accounts/{account}/balances/").get(
|
||||
"balances", []
|
||||
@@ -58,12 +59,9 @@ def sync(ctx: click.Context):
|
||||
"type": balance["balanceType"],
|
||||
"timestamp": datetime.datetime.now().timestamp(),
|
||||
}
|
||||
try:
|
||||
persist_balance(ctx, account, balance_document)
|
||||
except Exception as e:
|
||||
error(
|
||||
f"[{account}] Error: Sync failed, skipping account, exception: {e}"
|
||||
)
|
||||
error(f"[{account}] Error: Sync failed, skipping account, exception: {e}")
|
||||
continue
|
||||
|
||||
info(f"Syncing transactions for {len(accounts)} accounts")
|
||||
|
||||
Reference in New Issue
Block a user