DEFAULT_TASK_NAME,
this.taskFunctions.get(name) as TaskFunction<Data, Response>
)
+ this.sendTaskFunctionNamesToMainWorker()
return { status: true }
} catch (error) {
return { status: false, error: error as Error }
protected handleTaskFunctionOperationMessage (
message: MessageValue<Data>
): void {
- const { taskFunctionOperation, taskFunction, taskFunctionName } = message
+ const { taskFunctionOperation, taskFunctionName, taskFunction } = message
let response!: TaskFunctionOperationReturnType
if (taskFunctionOperation === 'add') {
response = this.addTaskFunction(
new Function(`return ${taskFunction as string}`)() as TaskFunction<
Data,
Response
- >
+ > /* NOSONAR */
)
} else if (taskFunctionOperation === 'remove') {
response = this.removeTaskFunction(taskFunctionName as string)
taskPerformance,
taskId
})
- return null
+ return undefined
})
.catch(error => {
this.sendToMainWorker({