Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
- mkdir -p $GOPATH/src/github.com && pushd $GOPATH/src/github.com && ln -s $HOME/build/optimizely optimizely && popd
script:
# Need to download packages explicitly
- mkdir $GOPATH/src/github.com/twmb && cd $GOPATH/src/github.com/twmb && git clone https://github.com/twmb/murmur3.git && cd $TRAVIS_BUILD_DIR
- pushd $GOPATH/src/github.com/twmb/murmur3 && git checkout v1.0.0 && popd
- go get -v -d ./...
# This pkg not in go 1.8
- go get github.com/stretchr/testify
Expand Down
14 changes: 7 additions & 7 deletions pkg/event/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,18 @@ func NewBatchEventProcessor(options ...BPOptionConfig) *BatchEventProcessor {
p.Q = NewInMemoryQueue(p.MaxQueueSize)
}

return p
}

// Start initializes the event processor
func (p *BatchEventProcessor) Start(ctx context.Context) {
if p.EventDispatcher == nil {
dispatcher := NewQueueEventDispatcher(p.metricsRegistry)
defer dispatcher.flushEvents()
p.EventDispatcher = dispatcher
}

pLogger.Debug("Batch event processor started")
return p
}

// Start does not do any initialization, just starts the ticker
func (p *BatchEventProcessor) Start(ctx context.Context) {

pLogger.Info("Batch event processor started")
p.startTicker(ctx)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/event/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func newExecutionContext() *utils.ExecGroup {
func TestDefaultEventProcessor_ProcessImpression(t *testing.T) {
eg := newExecutionContext()
processor := NewBatchEventProcessor()
processor.EventDispatcher = nil
processor.EventDispatcher = NewQueueEventDispatcher(processor.metricsRegistry)
eg.Go(processor.Start)

impression := BuildTestImpressionEvent()
Expand Down