Skip to content

Commit

Permalink
feat: update task access time (dragonflyoss#909)
Browse files Browse the repository at this point in the history
* update task access time when task is downloading

Signed-off-by: sunwp <[email protected]>
  • Loading branch information
244372610 authored Dec 10, 2021
1 parent 9d857ea commit 1e62cc4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cdn/supervisor/progress/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ func (pm *Manager) PublishPiece(ctx context.Context, taskID string, record *type
logger.Debugf("seed piece meta record %#v", record)
pm.mu.Lock(taskID, false)
defer pm.mu.UnLock(taskID, false)
// update task access time
if pm.taskMgr != nil {
if _, err := pm.taskMgr.Get(taskID); err != nil {
return err
}
}
err := pm.setPieceMetaRecord(taskID, record)
if err != nil {
return fmt.Errorf("set piece meta record: %v", err)
Expand Down

0 comments on commit 1e62cc4

Please sign in to comment.