Expose persistent collection gaps and public Congress links
Retain bill and attachment failure reasons and derive retry counts from saved cursors. Show gap details and retry exhaustion in the collection console while preserving historical records and retry limits. Convert Congress API bill links to public pages and cover diagnostics, mixed dated versions, persistent counts and legacy records with regression tests.
This commit is contained in:
1 parent
dcad5b76a8
commit
d5d350b7ec
8 files changed
+182
-14
No files matched your search
@@ -194,6 +194,8 @@ async def list_sources(session: Annotated[AsyncSession, Depends(get_session)]) -
|
||||
pending = sum(value['attempts'] < 3 for value in retries.values())
|
||||
documents = (source.history_cursor or {}).get('document_retries', {})
|
||||
document_pending = sum(value['attempts'] < 3 for value in documents.values())
|
||||
bills = (source.history_cursor or {}).get('bill_retries', {})
|
||||
bill_pending = sum(value['attempts'] < 3 for value in bills.values())
|
||||
attachment_stats[source.code] = {
|
||||
'attachment_gaps': len(retries),
|
||||
'attachment_retry_pending': pending,
|
||||
@@ -201,6 +203,9 @@ async def list_sources(session: Annotated[AsyncSession, Depends(get_session)]) -
|
||||
'document_gaps': len(documents),
|
||||
'document_retry_pending': document_pending,
|
||||
'document_retry_exhausted': len(documents) - document_pending,
|
||||
'unresolved_bills': len(bills),
|
||||
'bill_retry_pending': bill_pending,
|
||||
'bill_retry_exhausted': len(bills) - bill_pending,
|
||||
}
|
||||
return success(SourcesOut(
|
||||
manager_alive=bool(statuses),
|
||||
|
||||
Reference in new issue
Block a user