Commit e4d739c9 authored by Steven Allen's avatar Steven Allen

providers: flush batch on process close

parent 498dd816
......@@ -31,7 +31,7 @@ type ProviderManager struct {
// all non channel fields are meant to be accessed only within
// the run method
providers *lru.LRU
dstore ds.Datastore
dstore *autobatch.Datastore
newprovs chan *addProv
getprovs chan *getProv
......@@ -233,6 +233,8 @@ func (pm *ProviderManager) gc() {
func (pm *ProviderManager) run(proc goprocess.Process) {
tick := time.NewTicker(pm.cleanupInterval)
defer tick.Stop()
defer pm.dstore.Flush()
for {
select {
case np := <-pm.newprovs:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment