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

Method checkAbort

go/logic/migrator.go:447–466  ·  view source on GitHub ↗

checkAbort returns abort error if migration was aborted

()

Source from the content-addressed store, hash-verified

445
446// checkAbort returns abort error if migration was aborted
447func (mgtr *Migrator) checkAbort() error {
448 if abortErr := mgtr.migrationContext.GetAbortError(); abortErr != nil {
449 return abortErr
450 }
451
452 ctx := mgtr.migrationContext.GetContext()
453 if ctx != nil {
454 select {
455 case <-ctx.Done():
456 // Context cancelled but no abort error stored yet
457 if abortErr := mgtr.migrationContext.GetAbortError(); abortErr != nil {
458 return abortErr
459 }
460 return ctx.Err()
461 default:
462 // Not cancelled
463 }
464 }
465 return nil
466}
467
468// Migrate executes the complete migration logic. This is *the* major gh-ost function.
469func (mgtr *Migrator) Migrate() (err error) {

Callers 12

TestRevert_AbortsOnErrorFunction · 0.95
sleepWhileTrueMethod · 0.95
retryOperationMethod · 0.95
MigrateMethod · 0.95
RevertMethod · 0.95
iterateChunksMethod · 0.95
executeWriteFuncsMethod · 0.95

Calls 2

GetAbortErrorMethod · 0.80
GetContextMethod · 0.80