Skip to content

Commit 710df57

Browse files
committed
Fast path bundle cleanup on load
Signed-off-by: Michael Crosby <[email protected]>
1 parent 26e2dd6 commit 710df57

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)