()
| 348 | }); |
| 349 | |
| 350 | const cancelJob = (): void => { |
| 351 | if (cancellationStarted) { |
| 352 | return; |
| 353 | } |
| 354 | |
| 355 | cancellationStarted = true; |
| 356 | abortController.abort(); |
| 357 | spinner.text = 'Cancelling job'; |
| 358 | |
| 359 | void (async () => { |
| 360 | try { |
| 361 | await cloudconvert.call('DELETE', `jobs/${jobId}`); |
| 362 | closeCloudConvertSocket(cloudconvert); |
| 363 | spinner.fail(JOB_CANCELLED_MESSAGE); |
| 364 | rejectCancellation(new Error(JOB_CANCELLED_MESSAGE)); |
| 365 | } catch (error) { |
| 366 | closeCloudConvertSocket(cloudconvert); |
| 367 | spinner.fail('Job cancellation failed.'); |
| 368 | rejectCancellation(new Error(`Job cancellation failed: ${getErrorMessage(error)}`)); |
| 369 | } |
| 370 | })(); |
| 371 | }; |
| 372 | |
| 373 | signalEmitter.once('SIGINT', cancelJob); |
| 374 |
nothing calls this directly
no test coverage detected