jobs can also have indeterminate progress
parent
7a05c69d40
commit
5a393b4ec0
|
@ -7,7 +7,7 @@ use uuid::Uuid;
|
|||
pub struct Job {
|
||||
pub job_type: Option<JobType>,
|
||||
pub title: String,
|
||||
pub progress: f32,
|
||||
pub progress: Option<f32>,
|
||||
pub state: State,
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ impl JobContainer {
|
|||
|
||||
pub fn update_progress(&mut self, id: &JobId, progress: f32) -> Result<()> {
|
||||
if let Some(job) = self.jobs.get_mut(id) {
|
||||
job.progress = progress;
|
||||
job.progress = Some(progress);
|
||||
if progress >= 100.0 {
|
||||
job.state = State::Done;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue