fix(app_asset_service): correct parameter passing in get_or_create_assets method and remove unused method for published assets

This commit is contained in:
Harry
2026-01-22 22:46:45 +08:00
parent 521b66c488
commit 6ec4a093c2

View File

@ -398,7 +398,7 @@ class AppAssetService:
after_node_id: str | None,
) -> AppAssetNode:
with Session(db.engine, expire_on_commit=False) as session:
assets = AppAssetService.get_or_create_assets(session, app_model, account_id)
assets = AppAssetService.get_or_create_assets(session, app_model, account_id=account_id)
tree = assets.asset_tree
try:
@ -513,19 +513,6 @@ class AppAssetService:
presign_storage = FilePresignStorage(storage.storage_runner)
return presign_storage.get_download_url(storage_key, expires_in)
@staticmethod
def get_published_assets_by_workflow_id(tenant_id: str, app_id: str, workflow_id: str) -> AppAssets | None:
with Session(db.engine, expire_on_commit=False) as session:
return (
session.query(AppAssets)
.filter(
AppAssets.tenant_id == tenant_id,
AppAssets.app_id == app_id,
AppAssets.version == workflow_id,
)
.first()
)
@staticmethod
def get_source_zip_bytes(tenant_id: str, app_id: str, workflow_id: str) -> bytes | None:
source_zip_key = AssetPaths.build_source_zip(tenant_id, app_id, workflow_id)