perf(app): optimize FileMetadata queries by batching lookups

Multiple services were performing individual database queries for FileMetadata when resolving missing file names/sizes. This change batches the queries using `in_()` to reduce database round trips and improve performance.
This commit is contained in:
Timebomb2018
2026-04-13 18:52:43 +08:00
parent 10f1089198
commit 7ca80b5d01
3 changed files with 34 additions and 13 deletions

View File

@@ -279,7 +279,7 @@ class AppDslService:
tenant_id: uuid.UUID,
warnings: list,
now: datetime.datetime,
) -> tuple[type(App), list]:
) -> tuple[App, list[str]]:
"""覆盖已有应用的配置,类型不一致时抛出异常"""
app = self.db.query(App).filter(
App.id == app_id,