Fix sqlite storage for numconns 1

This commit is contained in:
Matt Joiner 2021-02-01 15:47:28 +11:00
parent d48c6ae6dc
commit 15ccbc95c6
2 changed files with 3 additions and 4 deletions

View File

@ -265,9 +265,8 @@ func NewPool(opts NewPoolOpts) (_ ConnPool, _ ProviderOpts, err error) {
}
return conns, ProviderOpts{
NumConns: opts.NumConns,
NoConcurrentBlobReads: opts.NoConcurrentBlobReads || opts.Memory,
BatchWrites: true,
//BatchWrites: opts.NumConns > 1,
NoConcurrentBlobReads: opts.NoConcurrentBlobReads || opts.Memory || opts.NumConns == 1,
BatchWrites: opts.NumConns > 1,
}, nil
}

View File

@ -330,7 +330,7 @@ func TestClientTransferVarious(t *testing.T) {
Wrapper: fileCachePieceResourceStorage,
}), 0},
{"Boltdb", storage.NewBoltDB, 0},
//sqliteLeecherStorageTestCase(1),
sqliteLeecherStorageTestCase(1),
sqliteLeecherStorageTestCase(2),
// This should use a number of connections equal to the number of CPUs
sqliteLeecherStorageTestCase(0),