From 80163b35b6faabd96a07704ba4c4c35a04a541d9 Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Fri, 8 Apr 2016 14:44:36 +0200 Subject: [PATCH] extracted on-throttle functions outside loop --- go/logic/migrator.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/go/logic/migrator.go b/go/logic/migrator.go index 6bf6772..4df0e4a 100644 --- a/go/logic/migrator.go +++ b/go/logic/migrator.go @@ -399,16 +399,14 @@ func (this *Migrator) iterateChunks() error { } func (this *Migrator) executeWriteFuncs() error { + onStartThrottling := func() { + log.Debugf("throttling writes") + } + onEndThrottling := func() { + log.Debugf("done throttling writes") + } for { - this.throttle( - func() { - log.Debugf("throttling writes") - }, - nil, - func() { - log.Debugf("done throttling writes") - }, - ) + this.throttle(onStartThrottling, nil, onEndThrottling) // We give higher priority to event processing, then secondary priority to // rowcopy select {