Merge pull request #2499 from crosbymichael/fast
Fast path bundle cleanup on load
This commit is contained in:
commit
d02728ff4a
@ -174,6 +174,15 @@ func (m *TaskManager) loadTasks(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// fast path
|
||||
bf, err := ioutil.ReadDir(bundle.Path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(bf) == 0 {
|
||||
bundle.Delete()
|
||||
continue
|
||||
}
|
||||
shim, err := loadShim(ctx, bundle, m.events, m.tasks)
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Errorf("cleanup dead shim %s", id)
|
||||
|
Loading…
Reference in New Issue
Block a user