Skip to content

Commit 9717c18

Browse files
committed
fix: ignore already exists errors in multi-worker init
1 parent c3e101d commit 9717c18

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

backend/app/database.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
"""Database configuration and session management"""
22

3+
import logging
4+
35
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine
46
from sqlalchemy.orm import DeclarativeBase
57

68
from app.config import get_settings
79

10+
logger = logging.getLogger(__name__)
811
settings = get_settings()
912

1013
engine = create_async_engine(
@@ -36,5 +39,12 @@ async def get_db() -> AsyncSession:
3639

3740
async def init_db():
3841
"""Initialize database tables"""
39-
async with engine.begin() as conn:
40-
await conn.run_sync(Base.metadata.create_all)
42+
try:
43+
async with engine.begin() as conn:
44+
await conn.run_sync(Base.metadata.create_all)
45+
except Exception as e:
46+
# Ignore "already exists" errors from race conditions with multiple workers
47+
if "already exists" in str(e):
48+
logger.debug("Database tables already exist, skipping creation")
49+
else:
50+
raise

frontend/src/pages/Setup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ export default function Setup() {
271271
border: "none",
272272
}}
273273
>
274-
Continue
274+
Sign up
275275
</Button>
276276
</Form.Item>
277277
</Form>
@@ -284,7 +284,7 @@ export default function Setup() {
284284
marginTop: 32,
285285
}}
286286
>
287-
LMStack
287+
© Infinirc LLC
288288
</p>
289289
</div>
290290
</div>

0 commit comments

Comments
 (0)