Migrate task directory

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2021-10-11 11:50:57 -07:00
parent 8b788d9dfe
commit 2cec3a34b1
3 changed files with 61 additions and 38 deletions

View File

@@ -128,3 +128,16 @@ func (l *TaskList) Delete(ctx context.Context, id string) {
delete(tasks, id)
}
}
func (l *TaskList) IsEmpty() bool {
l.mu.Lock()
defer l.mu.Unlock()
for ns := range l.tasks {
if len(l.tasks[ns]) > 0 {
return false
}
}
return true
}