database engine_config updated
This commit is contained in:
parent
fa66741b48
commit
410ee2d6c4
|
|
@ -9,10 +9,11 @@ from sqlalchemy.ext.declarative import declarative_base
|
||||||
|
|
||||||
engine_config = {
|
engine_config = {
|
||||||
"url": WagDatabase.DATABASE_URL,
|
"url": WagDatabase.DATABASE_URL,
|
||||||
"pool_size": 10,
|
"pool_size": 20,
|
||||||
"max_overflow": 0,
|
"max_overflow": 10,
|
||||||
"echo": False,
|
"echo": False,
|
||||||
"isolation_level": "READ COMMITTED",
|
"isolation_level": "READ COMMITTED",
|
||||||
|
"pool_pre_ping": True,
|
||||||
}
|
}
|
||||||
|
|
||||||
engine = create_engine(**engine_config)
|
engine = create_engine(**engine_config)
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,6 @@ def endpoint_restriction_available(request: Request, data: CheckEndpointAccess):
|
||||||
EndpointRestriction.endpoint_name.ilike(f"%{data.endpoint}%"),
|
EndpointRestriction.endpoint_name.ilike(f"%{data.endpoint}%"),
|
||||||
system=True,
|
system=True,
|
||||||
).data
|
).data
|
||||||
print("endpoint", endpoint)
|
|
||||||
if not endpoint:
|
if not endpoint:
|
||||||
EndpointRestriction.raise_http_exception(
|
EndpointRestriction.raise_http_exception(
|
||||||
status_code="HTTP_404_NOT_FOUND",
|
status_code="HTTP_404_NOT_FOUND",
|
||||||
|
|
@ -85,9 +84,7 @@ def endpoint_restriction_available(request: Request, data: CheckEndpointAccess):
|
||||||
data={},
|
data={},
|
||||||
)
|
)
|
||||||
event = Events.filter_one(Events.endpoint_id == endpoint.id).data
|
event = Events.filter_one(Events.endpoint_id == endpoint.id).data
|
||||||
print("event", event)
|
|
||||||
service = Service2Events.filter_one(Service2Events.event_id == event.id).data
|
service = Service2Events.filter_one(Service2Events.event_id == event.id).data
|
||||||
print("service", service)
|
|
||||||
if isinstance(token_dict, OccupantTokenObject):
|
if isinstance(token_dict, OccupantTokenObject):
|
||||||
event_occupant = Event2Occupant.filter_one(
|
event_occupant = Event2Occupant.filter_one(
|
||||||
Event2Occupant.event_service_id == service.service_id,
|
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.event_service_id == service.service_id,
|
||||||
Event2Employee.employee_id == token_dict.selected_company.employee_id,
|
Event2Employee.employee_id == token_dict.selected_company.employee_id,
|
||||||
).data
|
).data
|
||||||
print("event_employee", event_employee)
|
|
||||||
if not event_employee:
|
if not event_employee:
|
||||||
EndpointRestriction.raise_http_exception(
|
EndpointRestriction.raise_http_exception(
|
||||||
status_code="HTTP_404_NOT_FOUND",
|
status_code="HTTP_404_NOT_FOUND",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue