fix: warm cache for new session

This commit is contained in:
Rajat Ahuja 2025-11-24 12:10:09 -05:00
parent 8b270ed428
commit ba80d09da4
1 changed files with 2 additions and 1 deletions

View File

@ -152,8 +152,9 @@ async def get_or_create_session(
)
try:
db.add(honcho_session)
# Flush to ensure session exists in DB before adding peers
# Flush to ensure session exists in DB before adding peers and set flag to warm cache
await db.flush()
needs_cache_update = True
except IntegrityError:
await db.rollback()