mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Lint fixes
This commit is contained in:
parent
44f26ad061
commit
ef2d365775
@ -156,7 +156,7 @@ class SaasUserAuth(UserAuth):
|
||||
with session_maker() as session:
|
||||
tokens = session.query(AuthTokens).where(
|
||||
AuthTokens.keycloak_user_id == self.user_id
|
||||
)
|
||||
).all()
|
||||
|
||||
for token in tokens:
|
||||
idp_type = ProviderType(token.identity_provider)
|
||||
|
||||
@ -70,6 +70,7 @@ class DbSessionInjector(BaseModel, Injector[async_sessionmaker]):
|
||||
if gcp_connector is None:
|
||||
# Lazy import because lib does not import if user does not have posgres installed
|
||||
from google.cloud.sql.connector import Connector
|
||||
|
||||
gcp_connector = Connector()
|
||||
self._gcp_connector = gcp_connector
|
||||
|
||||
@ -89,6 +90,7 @@ class DbSessionInjector(BaseModel, Injector[async_sessionmaker]):
|
||||
if gcp_connector is None:
|
||||
# Lazy import because lib does not import if user does not have posgres installed
|
||||
from google.cloud.sql.connector import Connector
|
||||
|
||||
loop = asyncio.get_running_loop()
|
||||
gcp_connector = Connector(loop=loop)
|
||||
self._gcp_connector = gcp_connector
|
||||
|
||||
@ -510,6 +510,10 @@ async def delete_conversation(
|
||||
if v1_result is not None:
|
||||
return v1_result
|
||||
|
||||
# Close connections
|
||||
await db_session.close()
|
||||
await httpx_client.aclose()
|
||||
|
||||
# V0 conversation logic
|
||||
return await _delete_v0_conversation(conversation_id, user_id)
|
||||
|
||||
@ -551,11 +555,8 @@ async def _try_delete_v1_conversation(
|
||||
httpx_client,
|
||||
)
|
||||
)
|
||||
except (ValueError, TypeError):
|
||||
# Not a valid UUID, continue with V0 logic
|
||||
pass
|
||||
except Exception:
|
||||
# Some other error, continue with V0 logic
|
||||
# Continue with V0 logic
|
||||
pass
|
||||
|
||||
return result
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user