This commit is contained in:
parent
ce5d2c9fb4
commit
b9c6c831c1
3 changed files with 36 additions and 12 deletions
|
|
@ -68,6 +68,8 @@ pub async fn create_task(
|
|||
}
|
||||
|
||||
let task_id = Uuid::new_v4();
|
||||
tracing::info!(%task_id, goal = %payload.goal, "Creating new task");
|
||||
|
||||
let new_task = crate::entities::task::ActiveModel {
|
||||
id: sea_orm::Set(task_id),
|
||||
goal: sea_orm::Set(payload.goal),
|
||||
|
|
@ -95,6 +97,8 @@ pub async fn rerun_task(
|
|||
.await?
|
||||
.ok_or_else(|| crate::error::AppError::NotFound("Task not found".to_string()))?;
|
||||
|
||||
tracing::info!(task_id = %task.id, "Manually triggering task rerun");
|
||||
|
||||
tasks::execute_agent_run(
|
||||
&state.db,
|
||||
&state.scheduler,
|
||||
|
|
@ -132,6 +136,8 @@ pub async fn update_task(
|
|||
.into();
|
||||
|
||||
let mut task = task;
|
||||
tracing::info!(task_id = %id, goal = %payload.goal, "Updating task");
|
||||
|
||||
task.goal = sea_orm::Set(payload.goal);
|
||||
task.cron = sea_orm::Set(payload.cron.clone());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue