[PR #45] [MERGED] Use gorm connection pool #1221

Closed
opened 2025-12-29 02:29:16 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/45
Author: @juanfont
Created: 7/4/2021
Status: Merged
Merged: 7/4/2021
Merged by: @juanfont

Base: mainHead: reuse-gorm-connection


📝 Commits (1)

📊 Changes

15 files changed (+50 additions, -167 deletions)

View changed files

📝 api.go (+8 -20)
📝 app.go (+4 -7)
📝 app_test.go (+5 -0)
📝 cli.go (+3 -8)
📝 cli_test.go (+1 -6)
📝 db.go (+9 -14)
📝 machine.go (+1 -6)
📝 machine_test.go (+1 -6)
📝 namespaces.go (+7 -40)
📝 namespaces_test.go (+1 -5)
📝 preauth_keys.go (+4 -21)
📝 preauth_keys_test.go (+3 -15)
📝 routes.go (+1 -8)
📝 routes_test.go (+1 -6)
📝 utils.go (+1 -5)

📄 Description

This commit changes the code to rely on a single DB object for Headscale, so Gorm can reuse the connections.

When using Sqlite for long periods of time we would get an error on too many files open otherwise.


🔄 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/juanfont/headscale/pull/45 **Author:** [@juanfont](https://github.com/juanfont) **Created:** 7/4/2021 **Status:** ✅ Merged **Merged:** 7/4/2021 **Merged by:** [@juanfont](https://github.com/juanfont) **Base:** `main` ← **Head:** `reuse-gorm-connection` --- ### 📝 Commits (1) - [`ff9d99b`](https://github.com/juanfont/headscale/commit/ff9d99b9ea49818c3c432c8e197dd811d9adf651) Use gorm connection pool ### 📊 Changes **15 files changed** (+50 additions, -167 deletions) <details> <summary>View changed files</summary> 📝 `api.go` (+8 -20) 📝 `app.go` (+4 -7) 📝 `app_test.go` (+5 -0) 📝 `cli.go` (+3 -8) 📝 `cli_test.go` (+1 -6) 📝 `db.go` (+9 -14) 📝 `machine.go` (+1 -6) 📝 `machine_test.go` (+1 -6) 📝 `namespaces.go` (+7 -40) 📝 `namespaces_test.go` (+1 -5) 📝 `preauth_keys.go` (+4 -21) 📝 `preauth_keys_test.go` (+3 -15) 📝 `routes.go` (+1 -8) 📝 `routes_test.go` (+1 -6) 📝 `utils.go` (+1 -5) </details> ### 📄 Description This commit changes the code to rely on a single DB object for Headscale, so Gorm can reuse the connections. When using Sqlite for long periods of time we would get an error on too many files open otherwise. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 02:29:16 +01:00
adam closed this issue 2025-12-29 02:29:16 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1221