Skip to content

Commit d02728f

Browse files
authored
Merge pull request #2499 from crosbymichael/fast
Fast path bundle cleanup on load
2 parents 26e2dd6 + 710df57 commit d02728f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

runtime/v2/manager.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,15 @@ func (m *TaskManager) loadTasks(ctx context.Context) error {
174174
if err != nil {
175175
return err
176176
}
177+
// fast path
178+
bf, err := ioutil.ReadDir(bundle.Path)
179+
if err != nil {
180+
return err
181+
}
182+
if len(bf) == 0 {
183+
bundle.Delete()
184+
continue
185+
}
177186
shim, err := loadShim(ctx, bundle, m.events, m.tasks)
178187
if err != nil {
179188
log.G(ctx).WithError(err).Errorf("cleanup dead shim %s", id)

0 commit comments

Comments
 (0)