diff --git a/core/task/roster.go b/core/task/roster.go index 34f31592..59d8c3b3 100644 --- a/core/task/roster.go +++ b/core/task/roster.go @@ -96,7 +96,10 @@ func (m *roster) getTasks() Tasks { m.mu.RLock() defer m.mu.RUnlock() - return m.tasks + tasks:= make(Tasks, len(m.tasks)) + copy(tasks, m.tasks) + + return tasks } func (m *roster) updateTasks(tasks Tasks) {