Merge pull request #1866 from Random-Liu/lock-task-list

Lock task list properly.
This commit is contained in:
Akihiro Suda
2017-12-04 13:02:48 +09:00
committed by GitHub

View File

@@ -49,6 +49,8 @@ func (l *TaskList) Get(ctx context.Context, id string) (Task, error) {
// GetAll tasks under a namespace
func (l *TaskList) GetAll(ctx context.Context) ([]Task, error) {
l.mu.Lock()
defer l.mu.Unlock()
namespace, err := namespaces.NamespaceRequired(ctx)
if err != nil {
return nil, err