aboutsummaryrefslogtreecommitdiff
path: root/repository/refs_timeout.go
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-07 18:09:20 +0800
committerGravatar Runxi Yu2026-03-07 18:17:54 +0800
commite667c3c52a535ee67fe895bb0240fbad6e920087 (patch)
tree0815f7cc9b2c4a06d00722bce4c3ac57c515288b /repository/refs_timeout.go
parentreceivepack: Connect protocol with service (diff)
signatureNo signature
refstore/files: Accept timeout instead of reading from config
And split things up again.
Diffstat (limited to 'repository/refs_timeout.go')
-rw-r--r--repository/refs_timeout.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/repository/refs_timeout.go b/repository/refs_timeout.go
new file mode 100644
index 00000000..275613ba
--- /dev/null
+++ b/repository/refs_timeout.go
@@ -0,0 +1,16 @@
+package repository
+
+import (
+ "time"
+
+ "codeberg.org/lindenii/furgit/config"
+)
+
+func detectPackedRefsTimeout(cfg *config.Config) time.Duration {
+ timeoutValue, err := cfg.Lookup("core", "", "packedrefstimeout").Int()
+ if err != nil {
+ return time.Second
+ }
+
+ return time.Duration(timeoutValue) * time.Millisecond
+}