server/worker_task: improve endtime for unknown tasks
instead of always using the starttime, use the last timestamp from the log this way, one can see when the task was aborted without having to read the log Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
2892624783
commit
ef0ea4ba05
@ -207,6 +207,8 @@ pub fn upid_read_status(upid: &UPID) -> Result<TaskState, Error> {
|
||||
let mut iter = last_line.splitn(2, ": ");
|
||||
if let Some(time_str) = iter.next() {
|
||||
if let Ok(endtime) = proxmox::tools::time::parse_rfc3339(time_str) {
|
||||
// set the endtime even if we cannot parse the state
|
||||
status = TaskState::Unknown { endtime };
|
||||
if let Some(rest) = iter.next().and_then(|rest| rest.strip_prefix("TASK ")) {
|
||||
if let Ok(state) = TaskState::from_endtime_and_message(endtime, rest) {
|
||||
status = state;
|
||||
|
Loading…
Reference in New Issue
Block a user