trying to get better log
@@ -143,7 +143,7 @@ func (e *Events) GetMany(events []string, start string, end string, blockCount u
wg.Add(1)
go func() {
defer wg.Done()
- eventWorker(jobChan, results, e)
+ e.eventWorker(jobChan, results)
}()
}
@@ -173,9 +173,10 @@ func (e *Events) GetMany(events []string, start string, end string, blockCount u
}
-func eventWorker(jobChan <-chan client.EventRangeQuery, results chan<- EventWorkerResult, event *Events) {
+func (e *Events) eventWorker(jobChan <-chan client.EventRangeQuery, results chan<- EventWorkerResult) {
for q := range jobChan {
- blockEvents, err := event.gateway.GetEvents(q.Type, q.StartHeight, q.EndHeight)
+ e.logger.StartProgress(fmt.Sprintf("Fetching events %v", q))
+ blockEvents, err := e.gateway.GetEvents(q.Type, q.StartHeight, q.EndHeight)
if err != nil {
results <- EventWorkerResult{nil, err}
}
