Skip to content

Commit

Permalink
fix: use getTask instead of taskStore.Get, for the error cause type (#…
Browse files Browse the repository at this point in the history
…571)

Signed-off-by: zzy987 <67889264+zzy987@users.noreply.github.com>
  • Loading branch information
zzy987 authored Aug 24, 2021
1 parent f180bd1 commit 64e83a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions cdnsystem/supervisor/cdn/storage/storage_gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@ func (cleaner *Cleaner) GC(storagePattern string, force bool) ([]string, error)
walkTaskIds[taskID] = true

// we should return directly when we success to get info which means it is being used
if _, err := cleaner.taskMgr.Get(taskID); err == nil || !cdnerrors.IsDataNotFound(err) {
if err != nil {
logger.GcLogger.With("type", storagePattern).Errorf("failed to get taskID(%s): %v", taskID, err)
}
if cleaner.taskMgr.Exist(taskID) {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion cdnsystem/supervisor/task/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func (tm Manager) Get(taskID string) (*types.SeedTask, error) {
}

func (tm Manager) Exist(taskID string) bool {
_, err := tm.taskStore.Get(taskID)
_, err := tm.getTask(taskID)
return err == nil || !cdnerrors.IsDataNotFound(err)
}

Expand Down

0 comments on commit 64e83a9

Please sign in to comment.