don't try to (non-recursively) remove directories from the data tmp dir

mox only creates files there. directories could be a backup that is being
transferred to elsewhere.
This commit is contained in:
Mechiel Lukkien 2023-08-15 09:51:52 +02:00
parent fdbbfb765b
commit 02a03710dc
No known key found for this signature in database

View file

@ -364,7 +364,7 @@ requested, other TLS certificates are requested on demand.
for _, e := range tmps {
if fi, err := e.Info(); err != nil {
log.Errorx("stat tmp file", err, mlog.Field("filename", e.Name()))
} else if now.Sub(fi.ModTime()) > 7*24*time.Hour {
} else if now.Sub(fi.ModTime()) > 7*24*time.Hour && !fi.IsDir() {
p := filepath.Join(tmpdir, e.Name())
if err := os.Remove(p); err != nil {
log.Errorx("removing stale temporary file", err, mlog.Field("path", p))