Slash commands (#5718)

Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Douwe Osinga
2025-11-20 21:14:15 +01:00
committed by GitHub
parent 6e511d1e8a
commit bdf68bb4f5
28 changed files with 1675 additions and 1048 deletions
+16 -2
View File
@@ -1,14 +1,28 @@
use async_trait::async_trait;
use chrono::{DateTime, Utc};
use std::path::PathBuf;
use crate::scheduler::{ScheduledJob, SchedulerError};
use crate::session::Session;
#[async_trait]
pub trait SchedulerTrait: Send + Sync {
async fn add_scheduled_job(&self, job: ScheduledJob) -> Result<(), SchedulerError>;
async fn add_scheduled_job(
&self,
job: ScheduledJob,
copy_recipe: bool,
) -> Result<(), SchedulerError>;
async fn schedule_recipe(
&self,
recipe_path: PathBuf,
cron_schedule: Option<String>,
) -> anyhow::Result<(), SchedulerError>;
async fn list_scheduled_jobs(&self) -> Vec<ScheduledJob>;
async fn remove_scheduled_job(&self, id: &str) -> Result<(), SchedulerError>;
async fn remove_scheduled_job(
&self,
id: &str,
remove_recipe: bool,
) -> Result<(), SchedulerError>;
async fn pause_schedule(&self, id: &str) -> Result<(), SchedulerError>;
async fn unpause_schedule(&self, id: &str) -> Result<(), SchedulerError>;
async fn run_now(&self, id: &str) -> Result<String, SchedulerError>;