diff options
Diffstat (limited to 'server/helpers/database-utils.ts')
-rw-r--r-- | server/helpers/database-utils.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/helpers/database-utils.ts b/server/helpers/database-utils.ts index 9b861a88c..ededa7901 100644 --- a/server/helpers/database-utils.ts +++ b/server/helpers/database-utils.ts | |||
@@ -22,11 +22,15 @@ function retryTransactionWrapper <T, A> ( | |||
22 | ): Promise<T> | 22 | ): Promise<T> |
23 | 23 | ||
24 | function retryTransactionWrapper <T> ( | 24 | function retryTransactionWrapper <T> ( |
25 | functionToRetry: () => Promise<T> | Bluebird<T> | ||
26 | ): Promise<T> | ||
27 | |||
28 | function retryTransactionWrapper <T> ( | ||
25 | functionToRetry: (...args: any[]) => Promise<T> | Bluebird<T>, | 29 | functionToRetry: (...args: any[]) => Promise<T> | Bluebird<T>, |
26 | ...args: any[] | 30 | ...args: any[] |
27 | ): Promise<T> { | 31 | ): Promise<T> { |
28 | return transactionRetryer<T>(callback => { | 32 | return transactionRetryer<T>(callback => { |
29 | functionToRetry.apply(this, args) | 33 | functionToRetry.apply(null, args) |
30 | .then((result: T) => callback(null, result)) | 34 | .then((result: T) => callback(null, result)) |
31 | .catch(err => callback(err)) | 35 | .catch(err => callback(err)) |
32 | }) | 36 | }) |