feat: add ledger backfill command
Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
co-authored by
genichin
parent
f124e9509c
commit
e2c4bbba34
@@ -205,6 +205,13 @@ class LedgerWriter:
|
||||
stats.delivery_failed += 1
|
||||
return stats
|
||||
|
||||
def process_correlation_id(self, correlation_id: str) -> OutboxOutcome | None:
|
||||
"""Process one specific outbox row immediately."""
|
||||
item = self._outbox.get(correlation_id)
|
||||
if item is None:
|
||||
return None
|
||||
return self._process(item)
|
||||
|
||||
def _backoff_delay(self, attempts: int) -> float:
|
||||
"""Exponential backoff with jitter: min(base*2^(n-1), cap) + up to 25%."""
|
||||
base_delay = min(self._retry_base * (2 ** (attempts - 1)), self._retry_cap)
|
||||
|
||||
Reference in New Issue
Block a user