diff --git a/Gopkg.lock b/Gopkg.lock index d86d581..2722115 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,10 +2,10 @@ [[projects]] - branch = "master" name = "bitbucket.org/creachadair/cityhash" packages = ["."] - revision = "0d1506f40c89df1b983c65d94162627c41a330a4" + revision = "b2a225bf6663ceaaf4ee276eb02d3a3f3920b100" + version = "v0.0.1" [[projects]] branch = "master" @@ -59,8 +59,8 @@ [[projects]] name = "github.com/ethereum/go-ethereum" packages = ["crypto/sha3"] - revision = "477eb0933b9529f7deeccc233cc815fe34a8ea56" - version = "v1.8.16" + revision = "8bbe72075e4e16442c4e28d999edee12e294329e" + version = "v1.8.17" [[projects]] name = "github.com/gogo/protobuf" @@ -187,7 +187,7 @@ "waved", "wve" ] - revision = "a07892dbbf6e9550af8bf7671b18ecd4a0175b13" + revision = "1202753333dac13b6b0865d1a55f2df4cc442b38" [[projects]] name = "github.com/matttproud/golang_protobuf_extensions" @@ -205,13 +205,13 @@ branch = "master" name = "github.com/minio/sha256-simd" packages = ["."] - revision = "ad98a36ba0da87206e3378c556abbfeaeaa98668" + revision = "51976451ce1942acbb55707a983ed232fa027110" [[projects]] - branch = "master" name = "github.com/mr-tron/base58" packages = ["base58"] - revision = "9ad991d48a423a0e52c77eac173b1b589665492a" + revision = "d724c80ecac7b49e4e562d58b2b4f4ee4ed8c312" + version = "v1.0.0" [[projects]] name = "github.com/multiformats/go-multihash" @@ -253,10 +253,11 @@ name = "github.com/prometheus/client_golang" packages = [ "prometheus", + "prometheus/internal", "prometheus/promhttp" ] - revision = "c5b7fccd204277076155f10851dad72b76a49317" - version = "v0.8.0" + revision = "1cafe34db7fdec6022e17e00e1c1ea501022f3e4" + version = "v0.9.0" [[projects]] branch = "master" @@ -272,7 +273,7 @@ "internal/bitbucket.org/ww/goautoneg", "model" ] - revision = "c7de2306084e37d54b8be01f3541a8464345e9a5" + revision = "bcb74de08d37a417cb6789eec1d6c810040f0470" [[projects]] branch = "master" @@ -283,7 +284,7 @@ "nfs", "xfs" ] - revision = "418d78d0b9a7b7de3a6bbc8a23def624cc977bb2" + revision = "185b4288413d2a0dd0806f78c90dde719829e5ae" [[projects]] name = "github.com/spaolacci/murmur3" @@ -317,7 +318,7 @@ "leveldb/table", "leveldb/util" ] - revision = "ae2bd5eed72d46b28834ec3f60db3a3ebedd8dbd" + revision = "6b91fda63f2e36186f1c9d0e48578defb69c5d43" [[projects]] name = "github.com/tinylib/msgp" @@ -373,7 +374,7 @@ "salsa20/salsa", "sha3" ] - revision = "e3636079e1a4c1f337f212cc5cd2aca108f6c900" + revision = "0c41d7ab0a0ee717d4590a44bcb987dfd9e183eb" [[projects]] branch = "master" @@ -387,7 +388,7 @@ "internal/timeseries", "trace" ] - revision = "f5e5bdd778241bfefa8627f7124c39cd6ad8d74f" + revision = "04a2e542c03f1d053ab3e4d6e5abcd4b66e2be8e" [[projects]] branch = "master" @@ -396,7 +397,7 @@ "cpu", "unix" ] - revision = "af653ce8b74f808d092db8ca9741fbb63d2a469d" + revision = "fa43e7bc11baaae89f3f902b2b4d832b68234844" [[projects]] name = "golang.org/x/text" @@ -427,7 +428,7 @@ "googleapis/rpc/status", "protobuf/field_mask" ] - revision = "c7e5094acea1ca1b899e2259d80a6b0f882f81f8" + revision = "94acd270e44e65579b9ee3cdab25034d33fed608" [[projects]] name = "google.golang.org/grpc" diff --git a/core/queues.go b/core/queues.go index fde5f07..14e57cc 100644 --- a/core/queues.go +++ b/core/queues.go @@ -242,10 +242,21 @@ func NewQManager(cfg *QManagerConfig) (*QManager, error) { return nil, err } go rv.bgTasks() + go rv.trimDB() return rv, nil } +func (qm *QManager) trimDB() { + for { + time.Sleep(5 * time.Minute) + again: + err := qm.db.RunValueLogGC(0.5) + if err == nil { + goto again + } + } +} func (qm *QManager) Shutdown() { qm.qzmu.Lock() for _, q := range qm.qz { diff --git a/core/routing.go b/core/routing.go index 1b6f700..70d030b 100644 --- a/core/routing.go +++ b/core/routing.go @@ -11,7 +11,7 @@ import ( "time" "github.com/dgraph-io/badger" - "github.com/gogo/protobuf/proto" + "github.com/golang/protobuf/proto" "github.com/immesys/wave/wve" pb "github.com/immesys/wavemq/mqpb" "github.com/prometheus/client_golang/prometheus" @@ -286,9 +286,20 @@ func NewTerminus(qm *QManager, am *AuthModule, cfg *RoutingConfig) (*Terminus, e //Run the BG tasks go rv.bgTasks() + go rv.trimDB() return rv, nil } +func (t *Terminus) trimDB() { + for { + time.Sleep(30 * time.Minute) + again: + err := t.db.RunValueLogGC(0.5) + if err == nil { + goto again + } + } +} func (t *Terminus) RouterID() string { return t.ourNodeId }