database engine_config updated

This commit is contained in:
berkay 2025-01-04 11:00:23 +03:00
parent fa66741b48
commit 410ee2d6c4
2 changed files with 3 additions and 6 deletions

View File

@ -9,10 +9,11 @@ from sqlalchemy.ext.declarative import declarative_base
engine_config = {
"url": WagDatabase.DATABASE_URL,
"pool_size": 10,
"max_overflow": 0,
"pool_size": 20,
"max_overflow": 10,
"echo": False,
"isolation_level": "READ COMMITTED",
"pool_pre_ping": True,
}
engine = create_engine(**engine_config)

View File

@ -76,7 +76,6 @@ def endpoint_restriction_available(request: Request, data: CheckEndpointAccess):
EndpointRestriction.endpoint_name.ilike(f"%{data.endpoint}%"),
system=True,
).data
print("endpoint", endpoint)
if not endpoint:
EndpointRestriction.raise_http_exception(
status_code="HTTP_404_NOT_FOUND",
@ -85,9 +84,7 @@ def endpoint_restriction_available(request: Request, data: CheckEndpointAccess):
data={},
)
event = Events.filter_one(Events.endpoint_id == endpoint.id).data
print("event", event)
service = Service2Events.filter_one(Service2Events.event_id == event.id).data
print("service", service)
if isinstance(token_dict, OccupantTokenObject):
event_occupant = Event2Occupant.filter_one(
Event2Occupant.event_service_id == service.service_id,
@ -110,7 +107,6 @@ def endpoint_restriction_available(request: Request, data: CheckEndpointAccess):
Event2Employee.event_service_id == service.service_id,
Event2Employee.employee_id == token_dict.selected_company.employee_id,
).data
print("event_employee", event_employee)
if not event_employee:
EndpointRestriction.raise_http_exception(
status_code="HTTP_404_NOT_FOUND",