Fixes in. Hooray.
This commit is contained in:
parent
7a3b11dc32
commit
981d3ea933
5 changed files with 2 additions and 60 deletions
|
|
@ -15,25 +15,6 @@ from .routes.index import init_index_routes
|
|||
from .routes.listing import init_listing_routes
|
||||
from .routes.entry import init_entry_routes
|
||||
|
||||
def _bind_pool_debug(engine):
|
||||
pool = engine.pool
|
||||
eid = id(engine)
|
||||
|
||||
@event.listens_for(pool, "checkout")
|
||||
def _on_checkout(dbapi_con, con_record, con_proxy):
|
||||
try:
|
||||
print(f"POOL CHECKOUT: {pool.status()} engine id= {eid}")
|
||||
except Exception:
|
||||
# pool.status is safe on SQLA 2.x, but let's be defensive
|
||||
print(f"POOL CHECKOUT (no status) engine id= {eid}")
|
||||
|
||||
@event.listens_for(pool, "checkin")
|
||||
def _on_checkin(dbapi_con, con_record):
|
||||
try:
|
||||
print(f"POOL CHECKIN: {pool.status()} engine id= {eid}")
|
||||
except Exception:
|
||||
print(f"POOL CHECKIN (no status) engine id= {eid}")
|
||||
|
||||
def create_app(config_cls=crudkit.DevConfig) -> Flask:
|
||||
app = Flask(__name__)
|
||||
|
||||
|
|
@ -43,8 +24,6 @@ def create_app(config_cls=crudkit.DevConfig) -> Flask:
|
|||
from sqlalchemy import event
|
||||
|
||||
engine = runtime.engine
|
||||
print(f"CRUDKit engine id={id(runtime.engine)} url={runtime.engine.url}")
|
||||
_bind_pool_debug(runtime.engine) # ← attach to the real engine’s pool
|
||||
|
||||
# quick status endpoint you can hit while clicking around
|
||||
@app.get("/_db_status")
|
||||
|
|
|
|||
|
|
@ -22,8 +22,7 @@ def init_index_routes(app):
|
|||
"fields": [
|
||||
"start_time",
|
||||
"contact.label",
|
||||
"work_item.label",
|
||||
"work_item.device_type.description"
|
||||
"work_item.label"
|
||||
],
|
||||
"sort": "start_time"
|
||||
})
|
||||
|
|
@ -65,8 +64,7 @@ def init_index_routes(app):
|
|||
{"field": "contact.label", "label": "Contact",
|
||||
"link": {"endpoint": "entry.entry", "params": {"id": "{contact.id}", "model": "user"}}},
|
||||
{"field": "work_item.label", "label": "Work Item",
|
||||
"link": {"endpoint": "entry.entry", "params": {"id": "{work_item.id}", "model": "inventory"}}},
|
||||
{"field": "work_item.device_type.description", "label": "Device Type"}
|
||||
"link": {"endpoint": "entry.entry", "params": {"id": "{work_item.id}", "model": "inventory"}}}
|
||||
]
|
||||
|
||||
logs = render_table(work_logs, columns=columns, opts={"object_class": "worklog"})
|
||||
|
|
|
|||
|
|
@ -125,12 +125,6 @@ def init_listing_routes(app):
|
|||
except Exception:
|
||||
svc_engine = None
|
||||
|
||||
print(
|
||||
"LISTING ENGINES: "
|
||||
f"runtime={id(rt_engine) if rt_engine else None} "
|
||||
f"session_factory.bind={id(sf_engine) if sf_engine else None} "
|
||||
f"service.bind={id(svc_engine) if svc_engine else None}"
|
||||
)
|
||||
# include limit and go
|
||||
window = service.seek_window(spec | {"limit": limit}, key=key, backward=backward, include_total=True)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue