Merge pull request #23256 from Raigen/master

[sequelize] extend RetryOptions with RegExp and Error
This commit is contained in:
Daniel Rosenwasser 2018-02-13 12:00:08 -08:00 committed by GitHub
commit ea43a0f23a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -10,6 +10,7 @@
// Philippe D'Alva <https://github.com/TitaneBoy>
// Carven Zhang <https://github.com/zjy01>
// Nikola Vidic <https://github.com/nidzov>
// Florian Oellerich <https://github.com/Raigen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@ -5313,7 +5314,7 @@ declare namespace sequelize {
/**
* Only retry a query if the error matches one of these strings.
*/
match?: string[];
match?: (string|RegExp|Error)[];
/**
* How many times a failing query is automatically retried. Set to 0 to disable retrying on SQL_BUSY error.

View File

@ -1235,7 +1235,7 @@ new Sequelize( {
username: 'user',
password: 'pass',
retry: {
match: ['failed'],
match: ['failed', /failed/i, Sequelize.ForeignKeyConstraintError],
max: 3
},
typeValidation: true