v1.0.0-dev: slim to the real product — merchant state machine only
This commit is contained in:
parent
c31518309d
commit
b4a81e0ab8
15 changed files with 286 additions and 2503 deletions
|
|
@ -37,6 +37,7 @@ from cardano_checkout.monitor import (
|
|||
DEFAULT_MAX_REPRICINGS,
|
||||
DEFAULT_PAYMENT_WINDOW_MINUTES,
|
||||
KOIOS_URL,
|
||||
PriceFn,
|
||||
check_pending_invoices,
|
||||
reprice_expired_invoices,
|
||||
)
|
||||
|
|
@ -64,6 +65,7 @@ class InvoiceScheduler:
|
|||
"""
|
||||
|
||||
store: InvoiceStore
|
||||
price_fn: Optional[PriceFn] = None
|
||||
koios_url: str = KOIOS_URL
|
||||
check_interval_seconds: int = 15
|
||||
reprice_interval_seconds: int = 60
|
||||
|
|
@ -84,9 +86,15 @@ class InvoiceScheduler:
|
|||
)
|
||||
|
||||
async def _job_reprice_expired(self) -> None:
|
||||
if self.price_fn is None:
|
||||
# No oracle wired — skip repricing silently. Consumers that
|
||||
# don't care about the USD-lock workflow (e.g. fixed-ADA
|
||||
# invoices) will never configure a price_fn; that's fine.
|
||||
return
|
||||
try:
|
||||
await reprice_expired_invoices(
|
||||
self.store,
|
||||
price_fn=self.price_fn,
|
||||
window_minutes=self.payment_window_minutes,
|
||||
max_repricings=self.max_repricings,
|
||||
limit=self.limit,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue