[PR #10304] [MERGED] server/internal/client/ollama: cleanup use of multiple counters #75499

Closed
opened 2026-05-05 07:55:29 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/10304
Author: @bmizerany
Created: 4/16/2025
Status: Merged
Merged: 4/16/2025
Merged by: @bmizerany

Base: mainHead: bmizerany/multiatomicint64


📝 Commits (1)

  • cba2afe server/internal/client/ollama: cleanup use of multiple counters

📊 Changes

1 file changed (+38 additions, -41 deletions)

View changed files

📝 server/internal/client/ollama/registry.go (+38 -41)

📄 Description

The completed and received counters must work in tandem and the code should better reflect that. Previously, the act of updating them was 2-3 lines of code duplicated in multiple places. This consolidates them into a single update closure for easy reading and maintenance.

This also simplifies error handling in places where we can use a return parameter and defer to handle the error case for updates.

Also, remove the old Layer field from the trackingReader struct.


🔄 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/10304 **Author:** [@bmizerany](https://github.com/bmizerany) **Created:** 4/16/2025 **Status:** ✅ Merged **Merged:** 4/16/2025 **Merged by:** [@bmizerany](https://github.com/bmizerany) **Base:** `main` ← **Head:** `bmizerany/multiatomicint64` --- ### 📝 Commits (1) - [`cba2afe`](https://github.com/ollama/ollama/commit/cba2afeb6ad6faf3ba450b9bc486649b1300d71f) server/internal/client/ollama: cleanup use of multiple counters ### 📊 Changes **1 file changed** (+38 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `server/internal/client/ollama/registry.go` (+38 -41) </details> ### 📄 Description The completed and received counters must work in tandem and the code should better reflect that. Previously, the act of updating them was 2-3 lines of code duplicated in multiple places. This consolidates them into a single update closure for easy reading and maintenance. This also simplifies error handling in places where we can use a return parameter and defer to handle the error case for updates. Also, remove the old Layer field from the trackingReader struct. --- <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-05-05 07:55:29 -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#75499