aboutsummaryrefslogtreecommitdiff
path: root/commitquery/queries_new.go
blob: c001dc3ed069f928a1e2adebc6b293f0ccff692a (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package commitquery

import (
	"runtime"

	commitgraphread "codeberg.org/lindenii/furgit/format/commitgraph/read"
	objectstore "codeberg.org/lindenii/furgit/object/store"
)

// New builds one concurrent-safe commit query service over one object store
// and optional commit-graph reader.
//
// Labels: Deps-Borrowed.
func New(store objectstore.ReadingStore, graph *commitgraphread.Reader) *Queries {
	maxIdle := max(runtime.GOMAXPROCS(0), 1)

	return &Queries{
		store:   store,
		graph:   graph,
		maxIdle: maxIdle,
	}
}