shithub: furgit

ref: ab174c473618dd3743881cf44e02c2db4d1ecd5f
dir: /repository/refs_timeout.go/

View raw version
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
}