feat: add jobs CRUD API with manual execution
- Full CRUD for backup jobs - Manual job trigger endpoint with background execution - Schedule creation endpoint - Tests for job creation, update, execution, and 404 cases
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
from fastapi import FastAPI
|
||||
from contextlib import asynccontextmanager
|
||||
from app.database import engine, Base
|
||||
from app.routers import sources, jobs
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
async with engine.begin() as conn:
|
||||
await conn.run_sync(Base.metadata.create_all)
|
||||
yield
|
||||
|
||||
app = FastAPI(title="Backup Tool API", lifespan=lifespan)
|
||||
|
||||
app.include_router(sources.router)
|
||||
app.include_router(jobs.router)
|
||||
Reference in New Issue
Block a user