Skip to content

Commit b10baa6

Browse files
authored
use go-datastore without go-process (#1051)
* use go-datastore without go-process
1 parent 3f3b7b6 commit b10baa6

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

go.mod

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/hashicorp/golang-lru v1.0.2
1212
github.com/ipfs/boxo v0.27.4
1313
github.com/ipfs/go-cid v0.5.0
14-
github.com/ipfs/go-datastore v0.7.0
14+
github.com/ipfs/go-datastore v0.8.0
1515
github.com/ipfs/go-detect-race v0.0.1
1616
github.com/ipfs/go-log v1.0.5
1717
github.com/ipfs/go-log/v2 v2.5.1
@@ -68,7 +68,6 @@ require (
6868
github.com/ipld/go-ipld-prime v0.21.0 // indirect
6969
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
7070
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
71-
github.com/jbenet/goprocess v0.1.4 // indirect
7271
github.com/klauspost/compress v1.18.0 // indirect
7372
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
7473
github.com/koron/go-ssdp v0.0.5 // indirect

go.sum

+2-4
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ github.com/ipfs/go-cid v0.5.0 h1:goEKKhaGm0ul11IHA7I6p1GmKz8kEYniqFopaB5Otwg=
158158
github.com/ipfs/go-cid v0.5.0/go.mod h1:0L7vmeNXpQpUS9vt+yEARkJ8rOg43DF3iPgn4GIN0mk=
159159
github.com/ipfs/go-datastore v0.1.0/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE=
160160
github.com/ipfs/go-datastore v0.1.1/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRVNdgPHtbHw=
161-
github.com/ipfs/go-datastore v0.7.0 h1:a6JMuRFKYhw6XXmIVoTthF8ZFm4QQXvLDXFhXRVv8Go=
162-
github.com/ipfs/go-datastore v0.7.0/go.mod h1:ucOWMfbOPI6ZEyaIB1q/+78RPLBPERfuUVYX1EPnNpQ=
161+
github.com/ipfs/go-datastore v0.8.0 h1:n8xKnoSTo/28L5KM+Jfz4kfohD889/afdWcDHve9VuY=
162+
github.com/ipfs/go-datastore v0.8.0/go.mod h1:BGN3N+sLTEWQUHMtOjmm2GKccMJnVFPgSLp6kshNqRk=
163163
github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk=
164164
github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps=
165165
github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk=
@@ -185,8 +185,6 @@ github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABo
185185
github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk=
186186
github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8/go.mod h1:Ly/wlsjFq/qrU3Rar62tu1gASgGw6chQbSh/XgIIXCY=
187187
github.com/jbenet/goprocess v0.1.3/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4=
188-
github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o=
189-
github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4=
190188
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
191189
github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
192190
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=

providers/providers_manager.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ func (pm *ProviderManager) run() {
146146
defer func() {
147147
gcTimer.Stop()
148148
if gcQuery != nil {
149-
// don't really care if this fails.
150-
_ = gcQuery.Close()
149+
gcQuery.Close()
151150
}
152151
if err := pm.dstore.Flush(context.Background()); err != nil {
153152
log.Error("failed to flush datastore: ", err)
@@ -180,9 +179,7 @@ func (pm *ProviderManager) run() {
180179
gp.resp <- provs[0:len(provs):len(provs)]
181180
case res, ok := <-gcQueryRes:
182181
if !ok {
183-
if err := gcQuery.Close(); err != nil {
184-
log.Error("failed to close provider GC query: ", err)
185-
}
182+
gcQuery.Close()
186183
gcTimer.Reset(pm.cleanupInterval)
187184

188185
// cleanup GC round

0 commit comments

Comments
 (0)