extracted on-throttle functions outside loop

This commit is contained in:
Shlomi Noach 2016-04-08 14:44:36 +02:00
parent a1a34b8150
commit 80163b35b6

View File

@ -399,16 +399,14 @@ func (this *Migrator) iterateChunks() error {
} }
func (this *Migrator) executeWriteFuncs() error { func (this *Migrator) executeWriteFuncs() error {
onStartThrottling := func() {
log.Debugf("throttling writes")
}
onEndThrottling := func() {
log.Debugf("done throttling writes")
}
for { for {
this.throttle( this.throttle(onStartThrottling, nil, onEndThrottling)
func() {
log.Debugf("throttling writes")
},
nil,
func() {
log.Debugf("done throttling writes")
},
)
// We give higher priority to event processing, then secondary priority to // We give higher priority to event processing, then secondary priority to
// rowcopy // rowcopy
select { select {