Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -35,6 +35,7 @@ MANAGEMENT_WHATSAPP_NUMBER = os.getenv("MANAGEMENT_WHATSAPP_NUMBER", "default_va
|
|
35 |
|
36 |
# --- Database Setup ---
|
37 |
Base = declarative_base()
|
|
|
38 |
|
39 |
class ChatHistory(Base):
|
40 |
__tablename__ = "chat_history"
|
@@ -80,7 +81,7 @@ engine = create_async_engine(
|
|
80 |
connect_args={"ssl": ssl_context, "timeout": 30}, # increase timeout as needed
|
81 |
)
|
82 |
|
83 |
-
|
84 |
async_session = sessionmaker(engine, class_=AsyncSession, expire_on_commit=False)
|
85 |
|
86 |
async def init_db():
|
|
|
35 |
|
36 |
# --- Database Setup ---
|
37 |
Base = declarative_base()
|
38 |
+
ssl_context = ssl.create_default_context(cafile="rds-combined-ca-bundle.pem")
|
39 |
|
40 |
class ChatHistory(Base):
|
41 |
__tablename__ = "chat_history"
|
|
|
81 |
connect_args={"ssl": ssl_context, "timeout": 30}, # increase timeout as needed
|
82 |
)
|
83 |
|
84 |
+
|
85 |
async_session = sessionmaker(engine, class_=AsyncSession, expire_on_commit=False)
|
86 |
|
87 |
async def init_db():
|