fix: support local storage runtime and schedule logs
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user