Remove progress from task

This commit is contained in:
Louis Dureuil 2024-11-12 12:23:13 +01:00
parent 6094bb299a
commit 1fcd5f091e
No known key found for this signature in database
5 changed files with 2 additions and 20 deletions

View File

@ -148,7 +148,6 @@ pub fn snapshot_task(task: &Task) -> String {
enqueued_at: _, enqueued_at: _,
started_at: _, started_at: _,
finished_at: _, finished_at: _,
progress: _,
error, error,
canceled_by, canceled_by,
details, details,

View File

@ -978,12 +978,7 @@ impl IndexScheduler {
Ok(( Ok((
ret.map(|task| { ret.map(|task| {
if processing.contains(task.uid) { if processing.contains(task.uid) {
Task { Task { status: Status::Processing, started_at: Some(started_at), ..task }
status: Status::Processing,
progress: progress.clone(),
started_at: Some(started_at),
..task
}
} else { } else {
task task
} }
@ -1025,7 +1020,6 @@ impl IndexScheduler {
enqueued_at: OffsetDateTime::now_utc(), enqueued_at: OffsetDateTime::now_utc(),
started_at: None, started_at: None,
finished_at: None, finished_at: None,
progress: None,
error: None, error: None,
canceled_by: None, canceled_by: None,
details: kind.default_details(), details: kind.default_details(),
@ -1606,8 +1600,6 @@ impl<'a> Dump<'a> {
enqueued_at: task.enqueued_at, enqueued_at: task.enqueued_at,
started_at: task.started_at, started_at: task.started_at,
finished_at: task.finished_at, finished_at: task.finished_at,
/// FIXME: should we update dump to contain progress information? 🤔
progress: None,
error: task.error, error: task.error,
canceled_by: task.canceled_by, canceled_by: task.canceled_by,
details: task.details, details: task.details,

View File

@ -345,8 +345,6 @@ impl IndexScheduler {
enqueued_at, enqueued_at,
started_at, started_at,
finished_at, finished_at,
/// FIXME: assert something here? ask tamo 🤔
progress: _,
error: _, error: _,
canceled_by, canceled_by,
details, details,

View File

@ -4,9 +4,7 @@ use time::{Duration, OffsetDateTime};
use crate::error::ResponseError; use crate::error::ResponseError;
use crate::settings::{Settings, Unchecked}; use crate::settings::{Settings, Unchecked};
use crate::tasks::{ use crate::tasks::{serialize_duration, Details, IndexSwap, Kind, Status, Task, TaskId};
serialize_duration, Details, IndexSwap, Kind, Status, Task, TaskId, TaskProgress,
};
#[derive(Debug, Clone, PartialEq, Eq, Serialize)] #[derive(Debug, Clone, PartialEq, Eq, Serialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
@ -29,8 +27,6 @@ pub struct TaskView {
pub started_at: Option<OffsetDateTime>, pub started_at: Option<OffsetDateTime>,
#[serde(with = "time::serde::rfc3339::option", default)] #[serde(with = "time::serde::rfc3339::option", default)]
pub finished_at: Option<OffsetDateTime>, pub finished_at: Option<OffsetDateTime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub progress: Option<TaskProgress>,
} }
impl TaskView { impl TaskView {
@ -47,7 +43,6 @@ impl TaskView {
enqueued_at: task.enqueued_at, enqueued_at: task.enqueued_at,
started_at: task.started_at, started_at: task.started_at,
finished_at: task.finished_at, finished_at: task.finished_at,
progress: task.progress.clone(),
} }
} }
} }

View File

@ -31,8 +31,6 @@ pub struct Task {
#[serde(with = "time::serde::rfc3339::option")] #[serde(with = "time::serde::rfc3339::option")]
pub finished_at: Option<OffsetDateTime>, pub finished_at: Option<OffsetDateTime>,
pub progress: Option<TaskProgress>,
pub error: Option<ResponseError>, pub error: Option<ResponseError>,
pub canceled_by: Option<TaskId>, pub canceled_by: Option<TaskId>,
pub details: Option<Details>, pub details: Option<Details>,