(VDB-371) Recheck queued storage

- Iterate through queued storage at defined interval, popping rows
  from the queue if successfully persisted
This commit is contained in:
Rob Mulholand
2019-05-01 12:30:37 -05:00
parent bf4b1687a0
commit 6a86de87b4
8 changed files with 251 additions and 80 deletions
+4 -1
View File
@@ -27,6 +27,7 @@ import (
"github.com/vulcanize/vulcanizedb/libraries/shared/constants"
"github.com/vulcanize/vulcanizedb/libraries/shared/fetcher"
storageUtils "github.com/vulcanize/vulcanizedb/libraries/shared/storage/utils"
"github.com/vulcanize/vulcanizedb/libraries/shared/transformer"
"github.com/vulcanize/vulcanizedb/libraries/shared/watcher"
"github.com/vulcanize/vulcanizedb/pkg/fs"
@@ -168,7 +169,9 @@ func watchEthStorage(w *watcher.StorageWatcher, wg *syn.WaitGroup) {
ticker := time.NewTicker(pollingInterval)
defer ticker.Stop()
for range ticker.C {
w.Execute()
errs := make(chan error)
rows := make(chan storageUtils.StorageDiffRow)
w.Execute(rows, errs, queueRecheckInterval)
}
}
+3 -2
View File
@@ -49,8 +49,9 @@ var (
)
const (
pollingInterval = 7 * time.Second
validationWindow = 15
pollingInterval = 7 * time.Second
queueRecheckInterval = 5 * time.Minute
validationWindow = 15
)
var rootCmd = &cobra.Command{