chore(api): cache the setup status to cut down DB access#36966
Conversation
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-06-05 00:42:26.802000994 +0000
+++ /tmp/pyrefly_pr.txt 2026-06-05 00:42:15.570946821 +0000
@@ -2081,7 +2081,7 @@
ERROR `SimpleNamespace` is not assignable to attribute `_current_tenant` with type `Tenant | None` [bad-assignment]
--> tests/unit_tests/controllers/console/test_workspace_members.py:63:43
ERROR `in` is not supported between `Literal['count']` and `None` [not-iterable]
- --> tests/unit_tests/controllers/console/test_wraps.py:213:16
+ --> tests/unit_tests/controllers/console/test_wraps.py:220:16
ERROR `SimpleNamespace` is not assignable to attribute `db` with type `SQLAlchemy` [bad-assignment]
--> tests/unit_tests/controllers/files/test_image_preview.py:23:17
ERROR `SimpleNamespace` is not assignable to attribute `request` with type `Request` [bad-assignment]
|
Pyrefly Type Coverage
|
|
try use closure. or class. |
|
@dosu how is this change |
|
This PR looks like a solid, well-thought-out optimization. Here's a quick review: What it does well:
Minor observations / suggestions:
Overall, this is a clean, minimal change that removes unnecessary DB load in the hot path. Looks good to merge. 👍 To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
Important
Fixes #<issue number>.Summary
Fix #36965 . Not using
@cachedue to reasons mentioned in the comment.sChecklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods