()
| 1876 | } |
| 1877 | |
| 1878 | func (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. |
| 1904 | func (mgtr *Migrator) finalCleanup() error { |
no test coverage detected