diff --git a/fixbackend/cloud_accounts/repository.py b/fixbackend/cloud_accounts/repository.py index aa8be30a..f7efc659 100644 --- a/fixbackend/cloud_accounts/repository.py +++ b/fixbackend/cloud_accounts/repository.py @@ -221,6 +221,7 @@ async def do_updade() -> CloudAccount: stored_account.failed_scan_count = cloud_account.failed_scan_count stored_account.last_task_id = cloud_account.last_task_id stored_account.last_scan_resources_errors = cloud_account.last_scan_resources_errors + stored_account.last_degraded_scan_started_at = cloud_account.last_degraded_scan_started_at self._update_state_dependent_fields(stored_account, cloud_account.state) diff --git a/tests/fixbackend/cloud_accounts/repository_test.py b/tests/fixbackend/cloud_accounts/repository_test.py index 23ed3ad1..16f359f9 100644 --- a/tests/fixbackend/cloud_accounts/repository_test.py +++ b/tests/fixbackend/cloud_accounts/repository_test.py @@ -201,6 +201,7 @@ def update_account(account: CloudAccount) -> CloudAccount: last_scan_resources_scanned=456, last_scan_started_at=timestamp, next_scan=timestamp + timedelta(hours=1), + last_degraded_scan_started_at=timestamp + timedelta(hours=1), ), ) with_last_scan = await cloud_account_repository.get(id=configured_account_id) @@ -209,6 +210,7 @@ def update_account(account: CloudAccount) -> CloudAccount: assert with_last_scan.last_scan_resources_scanned == 456 assert with_last_scan.last_scan_started_at == timestamp assert with_last_scan.next_scan == next_scan + assert with_last_scan.last_degraded_scan_started_at == timestamp + timedelta(hours=1) # delete await cloud_account_repository.delete(id=configured_account_id)