MCPcopy Create free account
hub / github.com/cloudconvert/cloudconvert-cli / cancelJob

Function cancelJob

src/job.ts:350–371  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

closeCloudConvertSocketFunction · 0.85
rejectCancellationFunction · 0.85
getErrorMessageFunction · 0.85
callMethod · 0.80
failMethod · 0.80

Tested by

no test coverage detected