File tree Expand file tree Collapse file tree 1 file changed +25
-21
lines changed Expand file tree Collapse file tree 1 file changed +25
-21
lines changed Original file line number Diff line number Diff line change @@ -283,27 +283,31 @@ class ModzyClient {
283283 */
284284 blockUntilComplete ( job ) {
285285 logger . debug ( `blockUntilComplete(${ job . jobIdentifier } }) :: ${ job . status } ` ) ;
286- return this . jobClient . getJob ( job . jobIdentifier )
287- . then (
288- ( updatedJob ) => {
289- if ( updatedJob . status === "SUBMITTED" || updatedJob . status === "IN_PROGRESS" ) {
290- return new Promise (
291- ( resolve , reject ) => {
292- setTimeout (
293- ( ) => {
294- resolve (
295- this . blockUntilComplete ( updatedJob )
296- ) ;
297- } ,
298- 20000
299- ) ;
300- }
301- ) ;
302- }
303- logger . debug ( `blockUntilComplete(${ updatedJob . jobIdentifier } }) :: returning :: ${ updatedJob . status } ` ) ;
304- return updatedJob ;
305- }
306- )
286+ return new Promise (
287+ ( resolve , reject ) => {
288+ setTimeout (
289+ ( ) => {
290+ this . jobClient . getJob ( job . jobIdentifier )
291+ . then (
292+ ( updatedJob ) => {
293+ if ( updatedJob . status === "SUBMITTED" || updatedJob . status === "IN_PROGRESS" ) {
294+ resolve ( this . blockUntilComplete ( updatedJob ) ) ;
295+ }
296+ logger . debug ( `blockUntilComplete(${ updatedJob . jobIdentifier } }) :: returning :: ${ updatedJob . status } ` ) ;
297+ resolve ( updatedJob ) ;
298+ }
299+ )
300+ . catch (
301+ ( error ) => {
302+ logger . error ( error ) ;
303+ reject ( error ) ;
304+ }
305+ ) ;
306+ } ,
307+ 2000
308+ ) ;
309+ }
310+ ) ;
307311 }
308312
309313 /**
You can’t perform that action at this time.
0 commit comments