Skip to content

Commit 71e42bf

Browse files
committed
Lock task list properly.
Signed-off-by: Lantao Liu <lantaol@google.com>
1 parent fe4e30c commit 71e42bf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

runtime/task_list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ func (l *TaskList) Get(ctx context.Context, id string) (Task, error) {
4949

5050
// GetAll tasks under a namespace
5151
func (l *TaskList) GetAll(ctx context.Context) ([]Task, error) {
52+
l.mu.Lock()
53+
defer l.mu.Unlock()
5254
namespace, err := namespaces.NamespaceRequired(ctx)
5355
if err != nil {
5456
return nil, err

0 commit comments

Comments
 (0)