// SetStatus sets the status of the model. func (m *Model) SetStatus(modelStatus status.Status, info string, data map[string]interface{}) error { st, closeState, err := m.getState() if err != nil { return errors.Trace(err) } defer closeState() if !status.ValidModelStatus(modelStatus) { return errors.Errorf("cannot set invalid status %q", modelStatus) } return setStatus(st, setStatusParams{ badge: "model", globalKey: m.globalKey(), status: modelStatus, message: info, rawData: data, }) }
// SetStatus sets the status of the model. func (m *Model) SetStatus(sInfo status.StatusInfo) error { st, closeState, err := m.getState() if err != nil { return errors.Trace(err) } defer closeState() if !status.ValidModelStatus(sInfo.Status) { return errors.Errorf("cannot set invalid status %q", sInfo.Status) } return setStatus(st, setStatusParams{ badge: "model", globalKey: m.globalKey(), status: sInfo.Status, message: sInfo.Message, rawData: sInfo.Data, updated: sInfo.Since, }) }