Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update task access time #909

Merged
merged 10 commits into from
Dec 10, 2021
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