fix: support local storage runtime and schedule logs

This commit is contained in:
Winnie
2026-08-14 15:06:36 +08:00
parent 65d14b8610
commit be475dd0d9
4 changed files with 64 additions and 11 deletions
+4 -6
View File
@@ -1,6 +1,5 @@
from __future__ import annotations
import asyncio
from datetime import UTC, datetime
from typing import Any, Literal
from urllib.parse import quote
@@ -19,6 +18,7 @@ from pydantic import Field
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from common.config import settings
from common.db.models import (
ScheduleNodeRuns,
ScheduleRuns,
@@ -199,7 +199,7 @@ async def _visible_artifact(
)
if (
item is None
or item.storage_backend != "rustfs"
or item.storage_backend != settings.storage_backend
or not item.bucket_name
or not item.object_key
):
@@ -223,10 +223,8 @@ async def _artifact_bytes(
item: StorageObjects,
request: Request,
) -> bytes:
return await asyncio.to_thread(
request.app.state.object_store.get_bytes,
bucket_name=item.bucket_name,
object_key=item.object_key,
return await request.app.state.object_stores[item.bucket_name].get(
item.object_key,
)