Slash commands (#5718)
Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user