MM-27449: Compliance Jobs rerun after warning status (#15178)

* add warning as success result

* revert config changes

* add unit test, update unit test

* add a couple more tests

* update store layers

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Scott Bishel
2020-08-17 21:18:33 -06:00
коммит произвёл GitHub
родитель d48eec6727
Коммит 0302e0f477
10 изменённых файлов: 144 добавлений и 5 удалений

Просмотреть файл

@@ -4027,6 +4027,24 @@ func (s *OpenTracingLayerJobStore) GetNewestJobByStatusAndType(status string, jo
return result, err
}
func (s *OpenTracingLayerJobStore) GetNewestJobByStatusesAndType(statuses []string, jobType string) (*model.Job, *model.AppError) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "JobStore.GetNewestJobByStatusesAndType")
s.Root.Store.SetContext(newCtx)
defer func() {
s.Root.Store.SetContext(origCtx)
}()
defer span.Finish()
result, err := s.JobStore.GetNewestJobByStatusesAndType(statuses, jobType)
if err != nil {
span.LogFields(spanlog.Error(err))
ext.Error.Set(span, true)
}
return result, err
}
func (s *OpenTracingLayerJobStore) Save(job *model.Job) (*model.Job, *model.AppError) {
origCtx := s.Root.Store.Context()
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "JobStore.Save")