Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions cashu/mint/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,18 @@ async def _startup_keysets(self) -> None:
await self.activate_keyset(derivation_path=derivation_path)

async def _run_regular_tasks(self) -> None:
try:
await self._check_pending_proofs_and_melt_quotes()
await asyncio.sleep(settings.mint_regular_tasks_interval_seconds)
except Exception as e:
logger.error(f"Ledger regular task failed: {e}")
await asyncio.sleep(60)
"""
Runs periodic ledger maintenance tasks forever.
This function intentionally loops forever and is designed to be scheduled as a Task.
"""
logger.info("Starting ledger regular tasks loop")
while True:
try:
await self._check_pending_proofs_and_melt_quotes()
await asyncio.sleep(settings.mint_regular_tasks_interval_seconds)
except Exception as e:
logger.error(f"Ledger regular task failed: {e}")
await asyncio.sleep(60)

async def _check_backends(self) -> None:
for method in self.backends:
Expand Down