[sequelize] extend RetryOptions

* Extend `RetryOptions.match` with `RegExp` and `Error` acording to `retry-as-promised`.
* Extend sequelize-tests.ts
This commit is contained in:
Florian Oellerich
2018-01-29 15:03:07 +01:00
parent d7e5361938
commit 8254317eca
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