monitor/monitor.go
func (m *Monitor) Start() {
	logger := m.logger.Add("method", "Start")
	ctx, cancel := context.WithCancel(context.Background())
	ticker := time.NewTicker(m.queryPause)
	m.stopMonitor = func() {
		ticker.Stop()
		cancel()
	}
	go func() {
		for {
			select {
			case <-ctx.Done():
				return
			case <-ticker.C:
				err := m.queryLogsAndCreateJobs(
					m.getFilterLogQueries, m.jobsProducers)
				if err != nil {
					logger.Warn(err.Error())
				}
			}
		}
	}()
}
func (m *Monitor) Start() {
	logger := m.logger.Add("method", "Start")
	ctx, cancel := context.WithCancel(context.Background())
	ticker := time.NewTicker(m.queryPause)
	m.stopMonitor = func() {
		ticker.Stop()
		cancel()
	}
	go func() {
		for {
			select {
			case <-ctx.Done():
				return
			case <-ticker.C:
				err := m.queryLogsAndCreateJobs(
					m.getFilterLogQueries, m.jobsProducers)
				if err != nil {
					logger.Warn(err.Error())
				}
			}
		}
	}()
}
func ( m * Monitor ) Start ( ) { logger := m . logger . Add ( " " , " " ) ctx , cancel := context . WithCancel ( context . Background ( ) ) ticker := time . NewTicker ( m . queryPause ) m . stopMonitor = func ( ) { ticker . Stop ( ) cancel ( ) } go func ( ) { for { select { case <- ctx . Done ( ) : return case <- ticker . C : err := m . queryLogsAndCreateJobs ( m . getFilterLogQueries , m . jobsProducers ) if err != nil { logger . Warn ( err . Error ( ) ) } } } } ( ) }
// Start starts scanning blockchain for events.
Start starts scanning blockchain for events .