skip os.removeAll() if PID does not exist

This commit is contained in:
Josh Yan 2024-06-20 08:51:35 -07:00
parent fedf71635e
commit 23e899f32d

View file

@ -87,6 +87,8 @@ func cleanupTmpDirs() {
} }
} else { } else {
slog.Debug("failed to open ollama.pid", "path", d, "error", err) slog.Debug("failed to open ollama.pid", "path", d, "error", err)
// No pid, ignore this tmpdir
continue
} }
err = os.RemoveAll(d) err = os.RemoveAll(d)
if err != nil { if err != nil {