Add gitlab ci support
This commit is contained in:
parent
112be80ebd
commit
2284f20207
36 changed files with 247 additions and 64 deletions
|
@ -2,6 +2,7 @@ import * as retry from 'async/retry'
|
|||
import * as Bluebird from 'bluebird'
|
||||
import { Model } from 'sequelize-typescript'
|
||||
import { logger } from './logger'
|
||||
import { Transaction } from 'sequelize'
|
||||
|
||||
function retryTransactionWrapper <T, A, B, C> (
|
||||
functionToRetry: (arg1: A, arg2: B, arg3: C) => Promise<T> | Bluebird<T>,
|
||||
|
@ -72,11 +73,18 @@ function resetSequelizeInstance (instance: Model<any>, savedFields: object) {
|
|||
})
|
||||
}
|
||||
|
||||
function afterCommitIfTransaction (t: Transaction, fn: Function) {
|
||||
if (t) return t.afterCommit(() => fn())
|
||||
|
||||
return fn()
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
resetSequelizeInstance,
|
||||
retryTransactionWrapper,
|
||||
transactionRetryer,
|
||||
updateInstanceWithAnother
|
||||
updateInstanceWithAnother,
|
||||
afterCommitIfTransaction
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue