Skip to content

Commit b118d54

Browse files
committed
fix: avoid aborting load of old recordings if an old recording thumbnail is pruned after call to Walk
1 parent a532c01 commit b118d54

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,9 @@ func main() {
631631
for _, input := range config.Inputs {
632632
err := filepath.Walk(input.RecordingDirectory(), func(fpath string, info fs.FileInfo, err error) error {
633633
if err != nil {
634+
if os.IsNotExist(err) {
635+
return nil // if something is pruned between call to Walk and Walk's call to Stat
636+
}
634637
return err
635638
}
636639
if !strings.HasSuffix(fpath, ".mp4") || !strings.Contains(fpath, input.ID) {
@@ -695,6 +698,9 @@ func main() {
695698
for _, input := range config.Inputs {
696699
err := filepath.Walk(input.RecordingDirectory(), func(fpath string, info fs.FileInfo, err error) error {
697700
if err != nil {
701+
if os.IsNotExist(err) {
702+
return nil // if something is pruned between call to Walk and Walk's call to Stat
703+
}
698704
return err
699705
}
700706
if !strings.HasSuffix(fpath, ".mp4") || !strings.Contains(fpath, input.ID) {

0 commit comments

Comments
 (0)