Default to sqlite piece completion for dir if cgo enabled
This commit is contained in:
parent
a4e84688ae
commit
ad421ea2d0
|
@ -0,0 +1,8 @@
|
|||
//go:build !cgo
|
||||
// +build !cgo
|
||||
|
||||
package storage
|
||||
|
||||
func NewDefaultPieceCompletionForDir(dir string) (PieceCompletion, error) {
|
||||
return NewBoltPieceCompletion(dir)
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
//go:build cgo
|
||||
// +build cgo
|
||||
|
||||
package storage
|
||||
|
||||
func NewDefaultPieceCompletionForDir(dir string) (PieceCompletion, error) {
|
||||
return NewSqlitePieceCompletion(dir)
|
||||
}
|
|
@ -18,7 +18,7 @@ type PieceCompletion interface {
|
|||
}
|
||||
|
||||
func pieceCompletionForDir(dir string) (ret PieceCompletion) {
|
||||
ret, err := NewBoltPieceCompletion(dir)
|
||||
ret, err := NewDefaultPieceCompletionForDir(dir)
|
||||
if err != nil {
|
||||
log.Printf("couldn't open piece completion db in %q: %s", dir, err)
|
||||
ret = NewMapPieceCompletion()
|
||||
|
|
Loading…
Reference in New Issue