feat(medusa): Update TransactionBaseService methods visibility
This commit is contained in:
@@ -31,7 +31,7 @@ export abstract class TransactionBaseService<
|
|||||||
return cloned as TChild
|
return cloned as TChild
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldRetryTransaction(
|
protected shouldRetryTransaction_(
|
||||||
err: { code: string } | Record<string, unknown>
|
err: { code: string } | Record<string, unknown>
|
||||||
): boolean {
|
): boolean {
|
||||||
if (!(err as { code: string })?.code) {
|
if (!(err as { code: string })?.code) {
|
||||||
@@ -50,7 +50,7 @@ export abstract class TransactionBaseService<
|
|||||||
* @param maybeErrorHandlerOrDontFail Potential error handler
|
* @param maybeErrorHandlerOrDontFail Potential error handler
|
||||||
* @return the result of the transactional work
|
* @return the result of the transactional work
|
||||||
*/
|
*/
|
||||||
async atomicPhase_<TResult, TError>(
|
protected async atomicPhase_<TResult, TError>(
|
||||||
work: (transactionManager: EntityManager) => Promise<TResult | never>,
|
work: (transactionManager: EntityManager) => Promise<TResult | never>,
|
||||||
isolationOrErrorHandler?:
|
isolationOrErrorHandler?:
|
||||||
| IsolationLevel
|
| IsolationLevel
|
||||||
@@ -118,7 +118,7 @@ export abstract class TransactionBaseService<
|
|||||||
)
|
)
|
||||||
return result
|
return result
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (this.shouldRetryTransaction(error)) {
|
if (this.shouldRetryTransaction_(error)) {
|
||||||
return this.manager_.transaction(
|
return this.manager_.transaction(
|
||||||
isolation as IsolationLevel,
|
isolation as IsolationLevel,
|
||||||
(m): Promise<never | TResult> => doWork(m)
|
(m): Promise<never | TResult> => doWork(m)
|
||||||
|
|||||||
Reference in New Issue
Block a user