Missing job error from serde_json::Error

This commit is contained in:
Ericson Fogo Soares
2022-09-07 23:23:04 -03:00
parent 3a8d0c91e9
commit fac10845df
2 changed files with 3 additions and 2 deletions

View File

@@ -26,6 +26,8 @@ pub enum JobError {
StateEncode(#[from] EncodeError),
#[error("Job state decode error: {0}")]
StateDecode(#[from] DecodeError),
#[error("Job metadata serialization error: {0}")]
MetadataSerialization(#[from] serde_json::Error),
#[error("Tried to resume a job with unknown name: job <name='{1}', uuid='{0}'>")]
UnknownJobName(Uuid, String),
#[error(

View File

@@ -307,8 +307,7 @@ impl StatefulJob for IndexerJob {
.expect("critical error: non-negative duration"),
);
// TODO: Serialize and return metadata here
Ok(None)
Ok(Some(serde_json::to_vec(state)?))
}
}