1
0

Actually, lets keep working instead of closing program if file cannot be deleted.

This commit is contained in:
Alexander Andreev 2022-02-10 23:06:24 +04:00
parent a0a80db606
commit 00b5b0c7d6
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -83,7 +83,7 @@ func main() {
for _, entry := range uploadsDir { for _, entry := range uploadsDir {
if time.Now().UTC().Sub(entry.ModTime().UTC()) >= time.Duration(config.Uploads.Limits.KeepForHours)*time.Hour { if time.Now().UTC().Sub(entry.ModTime().UTC()) >= time.Duration(config.Uploads.Limits.KeepForHours)*time.Hour {
if err := os.Remove(path.Join(config.Uploads.Directory, entry.Name())); err != nil { if err := os.Remove(path.Join(config.Uploads.Directory, entry.Name())); err != nil {
logErr.Fatalln("failed to remove file ", entry.Name(), ": ", err) logErr.Println("failed to remove file ", entry.Name(), ": ", err)
} }
deletedSize += entry.Size() deletedSize += entry.Size()
deletedCount++ deletedCount++