mirror of
https://github.com/status-im/go-waku.git
synced 2025-01-13 07:14:10 +00:00
fix: time calculation for fetching events
This commit is contained in:
parent
75486f8226
commit
2aea2f5ca5
@ -90,13 +90,14 @@ func (mf *MembershipFetcher) loadOldEvents(ctx context.Context, fromBlock, toBlo
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
t1Since := time.Since(t1)
|
||||
|
||||
t2 := time.Now()
|
||||
if err := handler(events); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
mf.log.Info("fetching events", zap.Uint64("from", fromBlock), zap.Uint64("to", fromBlock+maxBatchSize), zap.Int("numEvents", len(events)), zap.Duration("timeToFetch", time.Since(t1)), zap.Duration("timeToProcess", time.Since(t2)))
|
||||
mf.log.Info("fetching events", zap.Uint64("from", fromBlock), zap.Uint64("to", fromBlock+maxBatchSize), zap.Int("numEvents", len(events)), zap.Duration("timeToFetch", t1Since), zap.Duration("timeToProcess", time.Since(t2)))
|
||||
}
|
||||
|
||||
t1 := time.Now()
|
||||
@ -104,6 +105,7 @@ func (mf *MembershipFetcher) loadOldEvents(ctx context.Context, fromBlock, toBlo
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
t1Since := time.Since(t1)
|
||||
|
||||
// process all the fetched events
|
||||
t2 := time.Now()
|
||||
@ -112,7 +114,7 @@ func (mf *MembershipFetcher) loadOldEvents(ctx context.Context, fromBlock, toBlo
|
||||
return err
|
||||
}
|
||||
|
||||
mf.log.Info("fetching events", zap.Uint64("from", fromBlock), zap.Uint64("to", fromBlock+maxBatchSize), zap.Int("numEvents", len(events)), zap.Duration("timeToFetch", time.Since(t1)), zap.Duration("timeToProcess", time.Since(t2)))
|
||||
mf.log.Info("fetching events", zap.Uint64("from", fromBlock), zap.Uint64("to", fromBlock+maxBatchSize), zap.Int("numEvents", len(events)), zap.Duration("timeToFetch", t1Since), zap.Duration("timeToProcess", time.Since(t2)))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user