File tree Expand file tree Collapse file tree
libs/modules/order/use-cases Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,6 +93,9 @@ export const getOrderFromSessionResult = async (
9393 undefined ;
9494 let updateUserAction : ReturnType < typeof getUpdateUserAction > | undefined =
9595 undefined ;
96+ let incrementUserVersionAction :
97+ | ReturnType < typeof getIncrementUserVersionAction >
98+ | undefined = undefined ;
9699 if ( cartId ) {
97100 deleteCartAction = getDeleteCartAction ( cartId ) ;
98101 if ( userId ) {
@@ -107,7 +110,7 @@ export const getOrderFromSessionResult = async (
107110 }
108111
109112 if ( userId ) {
110- await getIncrementUserVersionAction ( userId ) . run ( ) ;
113+ incrementUserVersionAction = getIncrementUserVersionAction ( userId ) ;
111114 }
112115
113116 const [ , , [ order ] ] = await runBatchOperation (
@@ -117,6 +120,7 @@ export const getOrderFromSessionResult = async (
117120 deleteCartAction ,
118121 insertCartAction ,
119122 updateUserAction ,
123+ incrementUserVersionAction ,
120124 ) ;
121125
122126 if ( ! order ) {
Original file line number Diff line number Diff line change 11const MAX_RETRIES = 3 ;
22const ONE_INCREMENT = 1 ;
33const MIN_RETRIES = 0 ;
4- export const withRetry = < T , K > (
4+ export const withRetry = async < T , K > (
55 args : T ,
66 callBack : ( args : T ) => Promise < K > ,
77 retries : number = MIN_RETRIES ,
88) : Promise < K > => {
99 try {
10- return callBack ( args ) ;
10+ return await callBack ( args ) ;
1111 } catch ( error ) {
1212 if ( retries < MAX_RETRIES ) {
1313 return withRetry ( args , callBack , retries + ONE_INCREMENT ) ;
You can’t perform that action at this time.
0 commit comments