auto-save 2026-05-26 00:07 (+1, ~3)
This commit is contained in:
@@ -28,6 +28,8 @@ from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import FileResponse, JSONResponse, RedirectResponse
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
import db
|
||||
|
||||
load_dotenv()
|
||||
|
||||
JOBS_DIR = Path(os.getenv("JOBS_DIR", "./jobs")).resolve()
|
||||
@@ -1285,7 +1287,9 @@ def job_with_artifacts(job: Job) -> Job:
|
||||
|
||||
|
||||
def save_state(job: Job) -> None:
|
||||
(job_dir(job.id) / "state.json").write_text(job.model_dump_json(indent=2))
|
||||
state_path = job_dir(job.id) / "state.json"
|
||||
state_path.write_text(job.model_dump_json(indent=2))
|
||||
db.index_job(job.model_dump(), str(state_path))
|
||||
|
||||
|
||||
def update(job: Job, **kw) -> None:
|
||||
|
||||
Reference in New Issue
Block a user