-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or requestmaintenanceMaintenance and cleanup tasksMaintenance and cleanup tasks
Description
Summary
Add scheduled task system for automated maintenance and workflows.
Current State
No scheduled task system. Maintenance tasks (archive cleanup) rely on ad-hoc triggers.
Proposed Features
Built-in Scheduled Tasks
- Archive Cleanup: Permanently delete expired archived videos
- Analytics Aggregation: Pre-compute daily/weekly analytics
- Stale Job Recovery: Already exists, formalize as scheduled task
- Worker Health Check: Mark offline workers, cleanup dead sessions
- Storage Cleanup: Remove orphaned files
User-Configurable Schedules
- Schedule video publication (future publish date)
- Schedule video archival/deletion
- Schedule transcoding during off-peak hours
Task Framework
- Cron-like scheduling syntax
- Background task execution
- Task history and logging
- Manual task trigger
Database Schema
CREATE TABLE scheduled_tasks (
id TEXT PRIMARY KEY,
name TEXT NOT NULL,
schedule TEXT NOT NULL, -- cron expression
task_type TEXT NOT NULL,
config TEXT, -- JSON configuration
enabled BOOLEAN DEFAULT true,
last_run_at TIMESTAMP,
next_run_at TIMESTAMP,
last_status TEXT
);
CREATE TABLE task_history (
id TEXT PRIMARY KEY,
task_id TEXT REFERENCES scheduled_tasks(id),
started_at TIMESTAMP,
completed_at TIMESTAMP,
status TEXT,
result TEXT
);CLI Commands
vlog task list # List scheduled tasks
vlog task run <task-name> # Run task manually
vlog task enable/disable <task-name> # Toggle task
vlog task history <task-name> # View task historyImplementation Options
- APScheduler (Python scheduling library)
- Celery Beat (if using Celery for task queue)
- Simple cron-triggered CLI commands
Priority
Medium - improves operational automation
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestmaintenanceMaintenance and cleanup tasksMaintenance and cleanup tasks