sqlite storage: Buffer write requests
This commit is contained in:
parent
b0ebc856d9
commit
258585fd8b
|
@ -4,6 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
|
"expvar"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
|
@ -258,7 +259,7 @@ func NewProvider(pool ConnPool, opts ProviderOpts) (_ *provider, err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
writes := make(chan writeRequest)
|
writes := make(chan writeRequest, 1<<(20-14))
|
||||||
prov := &provider{pool: pool, writes: writes, opts: opts}
|
prov := &provider{pool: pool, writes: writes, opts: opts}
|
||||||
runtime.SetFinalizer(prov, func(p *provider) {
|
runtime.SetFinalizer(prov, func(p *provider) {
|
||||||
// This is done in a finalizer, as it's easier than trying to synchronize on whether the
|
// This is done in a finalizer, as it's easier than trying to synchronize on whether the
|
||||||
|
|
Loading…
Reference in New Issue