mirror of
https://github.com/datarhei/core.git
synced 2025-09-26 20:11:29 +08:00
Fix missing process data if process has been deleted meanwhile
This commit is contained in:
@@ -553,23 +553,34 @@ func (h *RestreamHandler) getProcess(id, filterString string) (api.Process, erro
|
||||
}
|
||||
|
||||
if wants["state"] {
|
||||
if state, err := h.restream.GetProcessState(id); err == nil {
|
||||
info.State = &api.ProcessState{}
|
||||
info.State.Unmarshal(state)
|
||||
state, err := h.restream.GetProcessState(id)
|
||||
if err != nil {
|
||||
return api.Process{}, err
|
||||
}
|
||||
|
||||
info.State = &api.ProcessState{}
|
||||
info.State.Unmarshal(state)
|
||||
|
||||
}
|
||||
|
||||
if wants["report"] {
|
||||
if log, err := h.restream.GetProcessLog(id); err == nil {
|
||||
info.Report = &api.ProcessReport{}
|
||||
info.Report.Unmarshal(log)
|
||||
log, err := h.restream.GetProcessLog(id)
|
||||
if err != nil {
|
||||
return api.Process{}, err
|
||||
}
|
||||
|
||||
info.Report = &api.ProcessReport{}
|
||||
info.Report.Unmarshal(log)
|
||||
}
|
||||
|
||||
if wants["metadata"] {
|
||||
if data, err := h.restream.GetProcessMetadata(id, ""); err == nil {
|
||||
info.Metadata = api.NewMetadata(data)
|
||||
data, err := h.restream.GetProcessMetadata(id, "")
|
||||
if err != nil {
|
||||
return api.Process{}, err
|
||||
}
|
||||
|
||||
info.Metadata = api.NewMetadata(data)
|
||||
|
||||
}
|
||||
|
||||
return info, nil
|
Reference in New Issue
Block a user