FastAPI backend (SQLite + APScheduler), Vue 3 frontend, MCP server for Claude integration, and Docker Compose stack. Includes campaign data model (campaigns → variants → subs), post history, sub rules, and Playwright-based Reddit posting layer migrated from claude-bridge/reddit-poster. Also seeds legacy campaigns (6) and sub rules (14) from reddit-poster history. Closes #1 (scaffold), resolves migration from claude-bridge.
22 lines
646 B
Python
22 lines
646 B
Python
"""Scheduler status endpoints."""
|
|
from __future__ import annotations
|
|
|
|
from fastapi import APIRouter
|
|
|
|
from app.services.scheduler import get_scheduler
|
|
|
|
router = APIRouter(prefix="/scheduler", tags=["scheduler"])
|
|
|
|
|
|
@router.get("/status")
|
|
async def scheduler_status():
|
|
"""Return running state and next-fire-time for all scheduled jobs."""
|
|
sched = get_scheduler()
|
|
jobs = []
|
|
for job in sched.get_jobs():
|
|
jobs.append({
|
|
"job_id": job.id,
|
|
"name": job.name,
|
|
"next_run": job.next_run_time.isoformat() if job.next_run_time else None,
|
|
})
|
|
return {"running": sched.running, "jobs": jobs}
|