refactor: migrate site read queries to explicit sessions

This commit is contained in:
jxxghp
2026-08-23 02:42:37 +08:00
parent e17e83bca3
commit adfe72cbaa
7 changed files with 54 additions and 45 deletions
+2 -3
View File
@@ -13,8 +13,8 @@
"runtime_to_db": [],
"workflow_to_db": []
},
"edge_count": 6420,
"edge_sha256": "7c586d713c6014eb485763f8b7704d9421d95ba7d145910a33163dcb36882914",
"edge_count": 6419,
"edge_sha256": "bc2f57394915b9f90921a91cc4630a4426975ee765ece75a1aa0640080e41b4f",
"edges": [
"app -> app.runtime",
"app -> app.runtime.compat",
@@ -3557,7 +3557,6 @@
"app.db.models.user -> app.db.decorators",
"app.db.models.userconfig -> app.db",
"app.db.models.userconfig -> app.db.base",
"app.db.models.userconfig -> app.db.decorators",
"app.db.models.workflow -> app.db",
"app.db.models.workflow -> app.db.base",
"app.db.models.workflow -> app.db.decorators",
+3 -28
View File
@@ -1,12 +1,12 @@
{
"model_decorators": {
"by_kind": {
"async_db_query": 49,
"async_db_query": 47,
"async_db_update": 0,
"db_query": 68,
"db_query": 65,
"db_update": 0
},
"count": 117,
"count": 112,
"methods": [
{
"decorator": "async_db_query",
@@ -263,26 +263,6 @@
"file": "app/db/models/site.py",
"method": "Site.list_order_by_pri"
},
{
"decorator": "async_db_query",
"file": "app/db/models/siteicon.py",
"method": "SiteIcon.async_get_by_domain"
},
{
"decorator": "db_query",
"file": "app/db/models/siteicon.py",
"method": "SiteIcon.get_by_domain"
},
{
"decorator": "async_db_query",
"file": "app/db/models/sitestatistic.py",
"method": "SiteStatistic.async_get_by_domain"
},
{
"decorator": "db_query",
"file": "app/db/models/sitestatistic.py",
"method": "SiteStatistic.get_by_domain"
},
{
"decorator": "async_db_query",
"file": "app/db/models/siteuserdata.py",
@@ -548,11 +528,6 @@
"file": "app/db/models/user.py",
"method": "User.async_get_by_name"
},
{
"decorator": "db_query",
"file": "app/db/models/userconfig.py",
"method": "UserConfig.get_by_key"
},
{
"decorator": "async_db_query",
"file": "app/db/models/workflow.py",