MCPcopy
hub / github.com/github/gh-ost / executeDMLWriteFuncs

Method executeDMLWriteFuncs

go/logic/migrator.go:1878–1901  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1876}
1877
1878func (mgtr *Migrator) executeDMLWriteFuncs() error {
1879 if mgtr.migrationContext.Noop {
1880 mgtr.migrationContext.Log.Debugf("Noop operation; not really executing DML write funcs")
1881 return nil
1882 }
1883 for {
1884 if atomic.LoadInt64(&mgtr.finishedMigrating) > 0 {
1885 return nil
1886 }
1887
1888 mgtr.throttler.throttle(nil)
1889
1890 select {
1891 case eventStruct := <-mgtr.applyEventsQueue:
1892 {
1893 if err := mgtr.onApplyEventStruct(eventStruct); err != nil {
1894 return err
1895 }
1896 }
1897 case <-time.After(time.Second):
1898 continue
1899 }
1900 }
1901}
1902
1903// finalCleanup takes actions at very end of migration, dropping tables etc.
1904func (mgtr *Migrator) finalCleanup() error {

Callers 1

RevertMethod · 0.95

Calls 3

onApplyEventStructMethod · 0.95
throttleMethod · 0.80
DebugfMethod · 0.65

Tested by

no test coverage detected