@@ -164,6 +164,10 @@ export class SplitPdfHook
164164 splitSize ,
165165 )
166166
167+ const oneSecond = 1000 ;
168+ const oneMinute = 1000 * 60 ;
169+ const sixtyMinutes = oneMinute * 60 ;
170+
167171 const headers = prepareRequestHeaders ( request ) ;
168172
169173 const requests : Request [ ] = [ ] ;
@@ -185,11 +189,10 @@ export class SplitPdfHook
185189 file . name ,
186190 firstPageNumber
187191 ) ;
188- const timeoutInMs = 60 * 10 * 1000 ;
189192 const req = new Request ( requestClone , {
190193 headers,
191194 body,
192- signal : AbortSignal . timeout ( timeoutInMs )
195+ signal : AbortSignal . timeout ( sixtyMinutes )
193196 } ) ;
194197 requests . push ( req ) ;
195198 setIndex += 1 ;
@@ -203,15 +206,14 @@ export class SplitPdfHook
203206 // These are the retry values from our api spec
204207 // We need to hardcode them here until we're able to reuse the SDK
205208 // from within this hook
206- const oneSecond = 1000 ;
207- const oneMinute = 1000 * 60 ;
209+
208210 const retryConfig = {
209211 strategy : "backoff" ,
210212 backoff : {
211213 initialInterval : oneSecond * 3 ,
212214 maxInterval : oneMinute * 12 ,
213215 exponent : 1.88 ,
214- maxElapsedTime : oneMinute * 30 ,
216+ maxElapsedTime : sixtyMinutes ,
215217 } ,
216218 } as RetryConfig ;
217219
@@ -223,7 +225,7 @@ export class SplitPdfHook
223225 try {
224226 const response = await retry (
225227 async ( ) => {
226- return await this . client ! . request ( req . clone ( ) ) ;
228+ return await this . client ! . request ( req ) ;
227229 } ,
228230 { config : retryConfig , statusCodes : retryCodes }
229231 ) ;
0 commit comments