Skip to content

Commit

Permalink
🧪 Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ff137 committed Feb 11, 2025
1 parent 3e5bce7 commit c51cae8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions acapy_agent/ledger/indy_vdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import os.path
import tempfile
import traceback
from datetime import date, datetime, timezone
from io import StringIO
from pathlib import Path
Expand Down Expand Up @@ -92,11 +93,12 @@ def __init__(
"""Private constructor. Use 'create_instance' to instantiate."""
LOGGER.debug(
"Initializing IndyVdrLedgerPool with name: %s, keepalive: %s, "
"cache_duration: %s, read_only: %s",
"cache_duration: %s, read_only: %s\nTraceback:\n%s",
name,
keepalive,
cache_duration,
read_only,
"".join(traceback.format_stack(limit=5)[:-1]),
)

# Instance attributes
Expand Down Expand Up @@ -190,7 +192,8 @@ async def get_or_create(
)
else:
LOGGER.debug(
"Found existing IndyVdrLedgerPool instance for config: %s", config_key
"Found existing IndyVdrLedgerPool instance for config: %s",
config_key,
)
instance = cls._instances[config_key]

Expand Down Expand Up @@ -252,7 +255,8 @@ async def release_instance(cls, instance: "IndyVdrLedgerPool"):
await instance.close()
del cls._instances[config_key]
LOGGER.debug(
"Successfully removed IndyVdrLedgerPool instance: %s", config_key
"Successfully removed IndyVdrLedgerPool instance: %s",
config_key,
)
else:
LOGGER.debug(
Expand Down Expand Up @@ -420,6 +424,11 @@ async def context_open(self):

async def context_close(self):
"""Release the reference and schedule closing of the pool ledger."""
LOGGER.debug(
"Context close called for pool %s\nTraceback:\n%s",
self.name,
"".join(traceback.format_stack(limit=5)[:-1]),
)

async def closer(timeout: int):
"""Close the pool ledger after a timeout."""
Expand Down

0 comments on commit c51cae8

Please sign in to comment.