mirror of
https://github.com/goharbor/harbor
synced 2025-04-20 16:28:56 +00:00
Skip to refresh execution status when unchanged (#17023)
fixes #16640 Signed-off-by: stonezdj <stonezdj@gmail.com>
This commit is contained in:
parent
6c02854921
commit
88b8a7ac2c
|
@ -205,10 +205,6 @@ 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
|
||||
|
@ -229,6 +225,14 @@ 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
|
||||
|
|
Loading…
Reference in New Issue
Block a user