mirror of
https://github.com/mjl-/mox.git
synced 2025-01-14 01:06:27 +03:00
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:
parent
fdbbfb765b
commit
02a03710dc
1 changed files with 1 additions and 1 deletions
2
serve.go
2
serve.go
|
@ -364,7 +364,7 @@ requested, other TLS certificates are requested on demand.
|
||||||
for _, e := range tmps {
|
for _, e := range tmps {
|
||||||
if fi, err := e.Info(); err != nil {
|
if fi, err := e.Info(); err != nil {
|
||||||
log.Errorx("stat tmp file", err, mlog.Field("filename", e.Name()))
|
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())
|
p := filepath.Join(tmpdir, e.Name())
|
||||||
if err := os.Remove(p); err != nil {
|
if err := os.Remove(p); err != nil {
|
||||||
log.Errorx("removing stale temporary file", err, mlog.Field("path", p))
|
log.Errorx("removing stale temporary file", err, mlog.Field("path", p))
|
||||||
|
|
Loading…
Reference in a new issue