Add missing unlock, run debug endpoint in benchmark
This commit is contained in:
parent
21b97d1e04
commit
ffb24a98f4
|
@ -5,6 +5,8 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
@ -21,6 +23,9 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
// Start HTTP server for pprof endpoint.
|
||||
go http.ListenAndServe(":9999", nil)
|
||||
|
||||
root := &cobra.Command{
|
||||
Use: "tsdb",
|
||||
Short: "CLI tool for tsdb",
|
||||
|
|
1
db.go
1
db.go
|
@ -229,6 +229,7 @@ func (db *DB) compact() error {
|
|||
|
||||
select {
|
||||
case <-db.stopc:
|
||||
db.mtx.RUnlock()
|
||||
return nil
|
||||
default:
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue