Merge pull request #8 from openark/ajm188-handle_driver_timeout_error

handle driver timeout error
This commit is contained in:
Shlomi Noach 2020-08-02 11:57:54 +03:00 committed by GitHub
commit 6012e8072d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -370,6 +370,8 @@ func (this *Applier) ReadMigrationMinValues(uniqueKey *sql.UniqueKey) error {
} }
} }
this.migrationContext.Log.Infof("Migration min values: [%s]", this.migrationContext.MigrationRangeMinValues) this.migrationContext.Log.Infof("Migration min values: [%s]", this.migrationContext.MigrationRangeMinValues)
err = rows.Err()
return err return err
} }
@ -391,6 +393,8 @@ func (this *Applier) ReadMigrationMaxValues(uniqueKey *sql.UniqueKey) error {
} }
} }
this.migrationContext.Log.Infof("Migration max values: [%s]", this.migrationContext.MigrationRangeMaxValues) this.migrationContext.Log.Infof("Migration max values: [%s]", this.migrationContext.MigrationRangeMaxValues)
err = rows.Err()
return err return err
} }
@ -443,6 +447,9 @@ func (this *Applier) CalculateNextIterationRangeEndValues() (hasFurtherRange boo
} }
hasFurtherRange = true hasFurtherRange = true
} }
if err = rows.Err(); err != nil {
return hasFurtherRange, err
}
if hasFurtherRange { if hasFurtherRange {
this.migrationContext.MigrationIterationRangeMaxValues = iterationRangeMaxValues this.migrationContext.MigrationIterationRangeMaxValues = iterationRangeMaxValues
return hasFurtherRange, nil return hasFurtherRange, nil