feat: stop current workflow interpretation

This commit is contained in:
karishmas6
2024-06-05 04:33:07 +05:30
parent 2afef05143
commit 5ce97d12ce

View File

@@ -177,5 +177,19 @@ export class WorkflowInterpreter {
this.socket.emit('finished');
};
/**
* Stops the current process of the interpretation of the workflow.
* @returns {Promise<void>}
*/
public stopInterpretation = async () => {
if (this.interpreter) {
logger.log('info', 'Stopping the interpretation.');
await this.interpreter.stop();
this.socket.emit('log', '----- The interpretation has been stopped -----', false);
} else {
logger.log('error', 'Cannot stop: No active interpretation.');
}
};
}