File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -379,13 +379,24 @@ func (this *Migrator) countTableRows() (err error) {
379
379
log .Debugf ("Noop operation; not really counting table rows" )
380
380
return nil
381
381
}
382
+
383
+ countRowsFunc := func () error {
384
+ if err := this .inspector .CountTableRows (); err != nil {
385
+ return err
386
+ }
387
+ if err := this .hooksExecutor .onRowCountComplete (); err != nil {
388
+ return err
389
+ }
390
+ return nil
391
+ }
392
+
382
393
if this .migrationContext .ConcurrentCountTableRows {
383
- go this .inspector .CountTableRows ()
384
394
log .Infof ("As instructed, counting rows in the background; meanwhile I will use an estimated count, and will update it later on" )
395
+ go countRowsFunc ()
385
396
// and we ignore errors, because this turns to be a background job
386
397
return nil
387
398
}
388
- return this . inspector . CountTableRows ()
399
+ return countRowsFunc ()
389
400
}
390
401
391
402
// Migrate executes the complete migration logic. This is *the* major gh-ost function.
You can’t perform that action at this time.
0 commit comments