Merge pull request #51 from valueonag/fix/psycopg.pool-windows
fixed windows error
This commit is contained in:
commit
625003dcc0
3 changed files with 16 additions and 1 deletions
6
app.py
6
app.py
|
|
@ -1,7 +1,13 @@
|
|||
import os
|
||||
import sys
|
||||
import asyncio
|
||||
|
||||
os.environ["NUMEXPR_MAX_THREADS"] = "12"
|
||||
|
||||
# Fix for Windows asyncio compatibility with psycopg
|
||||
if sys.platform == 'win32':
|
||||
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
||||
|
||||
from fastapi import FastAPI, HTTPException, Depends, Body, status, Response
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.openapi.models import OAuthFlows as OAuthFlowsModel
|
||||
|
|
|
|||
|
|
@ -1,8 +1,17 @@
|
|||
"""PostgreSQL checkpointer utilities for LangGraph memory."""
|
||||
|
||||
import sys
|
||||
import asyncio
|
||||
import logging
|
||||
from typing import Optional
|
||||
|
||||
# Fix for Windows asyncio compatibility with psycopg (backup in case app.py fix didn't apply)
|
||||
if sys.platform == 'win32':
|
||||
try:
|
||||
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
||||
except RuntimeError:
|
||||
pass # Already set
|
||||
|
||||
from langgraph.checkpoint.postgres.aio import AsyncPostgresSaver
|
||||
from psycopg_pool import AsyncConnectionPool
|
||||
from psycopg.rows import dict_row
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
## Web Framework & API
|
||||
fastapi==0.104.1
|
||||
fastapi==0.115.0 # Upgraded for Pydantic v2 compatibility
|
||||
websockets==12.0
|
||||
uvicorn==0.23.2
|
||||
python-multipart==0.0.6
|
||||
|
|
|
|||
Loading…
Reference in a new issue