diff --git a/agent/api/task/task.go b/agent/api/task/task.go index f353e750f67..d7432f72a03 100644 --- a/agent/api/task/task.go +++ b/agent/api/task/task.go @@ -2916,6 +2916,9 @@ func (task *Task) GetExecutionStoppedAt() time.Time { // String returns a human-readable string representation of this object func (task *Task) String() string { + task.lock.RLock() + defer task.lock.RUnlock() + return task.stringUnsafe() }