浏览代码

skip os.removeAll() if PID does not exist

Josh Yan 10 月之前
父节点
当前提交
23e899f32d
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      gpu/assets.go

+ 2 - 0
gpu/assets.go

@@ -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 {