Skip to content

Commit

Permalink
Reorder setup and cleanup tasks in database initialization process
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielluiz committed Nov 19, 2024
1 parent 3be43f5 commit 092d899
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/backend/base/langflow/services/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ async def initialize_services(*, fix_migration: bool = False) -> None:
await asyncio.to_thread(initialize_database, fix_migration=fix_migration)
async with get_db_service().with_async_session() as session:
settings_service = get_service(ServiceType.SETTINGS_SERVICE)
await setup_superuser(settings_service, session)
try:
await get_db_service().migrate_flows_if_auto_login()
except Exception as exc:
msg = "Error migrating flows"
logger.exception(msg)
raise RuntimeError(msg) from exc
await setup_superuser(settings_service, session)
await clean_transactions(settings_service, session)
await clean_vertex_builds(settings_service, session)
await clean_transactions(settings_service, session)
await clean_vertex_builds(settings_service, session)

0 comments on commit 092d899

Please sign in to comment.