Revert "Skip to refresh execution status when unchanged (#17023)" (#17111)

This reverts commit 88b8a7ac2c.

Signed-off-by: stonezdj <stonezdj@gmail.com>
This commit is contained in:
stonezdj(Daojun Zhang) 2022-07-04 18:10:59 +08:00 committed by GitHub
parent 8115484f32
commit c9d6ba1469
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -205,6 +205,10 @@ func (e *executionDAO) RefreshStatus(ctx context.Context, id int64) (bool, strin
// 3. bool: whether a retry is needed
// 4. error: the error
func (e *executionDAO) refreshStatus(ctx context.Context, id int64) (bool, string, bool, error) {
execution, err := e.Get(ctx, id)
if err != nil {
return false, "", false, err
}
metrics, err := e.GetMetrics(ctx, id)
if err != nil {
return false, "", false, err
@ -225,14 +229,6 @@ func (e *executionDAO) refreshStatus(ctx context.Context, id int64) (bool, strin
status = job.SuccessStatus.String()
}
execution, err := e.Get(ctx, id)
if err != nil {
return false, "", false, err
}
if status == execution.Status {
return false, status, false, nil // status not changed
}
ormer, err := orm.FromContext(ctx)
if err != nil {
return false, "", false, err