This commit is contained in:
@@ -25,8 +25,8 @@ if DB_URL.startswith("postgres"):
|
||||
pool_pre_ping=True, # Добавить проверку соединений
|
||||
connect_args={
|
||||
"sslmode": "disable",
|
||||
"connect_timeout": 40 # Добавить таймаут подключения
|
||||
}
|
||||
"connect_timeout": 40, # Добавить таймаут подключения
|
||||
},
|
||||
)
|
||||
else:
|
||||
engine = create_engine(DB_URL, echo=False, connect_args={"check_same_thread": False})
|
||||
|
@@ -168,12 +168,7 @@ class SearchService:
|
||||
if self.client:
|
||||
try:
|
||||
await asyncio.wait_for(
|
||||
self.client.index(
|
||||
index=self.index_name,
|
||||
id=str(shout.id),
|
||||
body=index_body
|
||||
),
|
||||
timeout=40.0
|
||||
self.client.index(index=self.index_name, id=str(shout.id), body=index_body), timeout=40.0
|
||||
)
|
||||
except asyncio.TimeoutError:
|
||||
logger.error(f"Indexing timeout for shout {shout.id}")
|
||||
|
Reference in New Issue
Block a user