Don't fail if a file is created in an invalid directory
This commit is contained in:
parent
6af685088e
commit
52fc0af6d0
|
@ -87,7 +87,11 @@ func main() {
|
|||
// Extract
|
||||
spath := strings.Split(strings.TrimPrefix(ev.Name, SubmissionDir), "/")
|
||||
|
||||
go treatSubmission(ev.Name, spath[1], spath[2])
|
||||
if len(spath) > 2 {
|
||||
go treatSubmission(ev.Name, spath[1], spath[2])
|
||||
} else {
|
||||
log.Println("Invalid new file:", ev.Name)
|
||||
}
|
||||
}
|
||||
case err := <-watcher.Error:
|
||||
log.Println("error:", err)
|
||||
|
|
Loading…
Reference in New Issue