[PR #6171] [MERGED] removeall to remove non-empty temp dirs #12043

Closed
opened 2026-04-12 23:47:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/6171
Author: @mxyng
Created: 8/5/2024
Status: Merged
Merged: 8/9/2024
Merged by: @mxyng

Base: mainHead: mxyng/remove-temp


📝 Commits (2)

  • ed6c8bf removeall to remove non-empty temp dirs
  • 43f9d92 close pid file

📊 Changes

1 file changed (+26 additions, -23 deletions)

View changed files

📝 gpu/assets.go (+26 -23)

📄 Description

os.Remove() does not remove non-empty directories so it'll error with directory not empty. instead, remove the expected content (ollama.pid and runners) individually, then remove the parent directory. remove the content explicitly so as to not accidentally remove things ollama does not own


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/6171 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 8/5/2024 **Status:** ✅ Merged **Merged:** 8/9/2024 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/remove-temp` --- ### 📝 Commits (2) - [`ed6c8bf`](https://github.com/ollama/ollama/commit/ed6c8bfe57e4678090b89fc8f6c4e08ce1b01040) removeall to remove non-empty temp dirs - [`43f9d92`](https://github.com/ollama/ollama/commit/43f9d92008bf1aaa2e89ca50c85761540f70c21a) close pid file ### 📊 Changes **1 file changed** (+26 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `gpu/assets.go` (+26 -23) </details> ### 📄 Description `os.Remove()` does not remove non-empty directories so it'll error with `directory not empty`. instead, remove the expected content (`ollama.pid` and `runners`) individually, then remove the parent directory. remove the content explicitly so as to not accidentally remove things ollama does not own --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-12 23:47:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#12043