- if (message.workerId === this.id && message.ready != null) {
- this.getMainWorker()?.on('message', this.messageListener.bind(this))
- this.sendToMainWorker({ ready: true, workerId: this.id })
+ if (message.workerId === this.id && message.ready === false) {
+ try {
+ this.getMainWorker().on('message', this.messageListener.bind(this))
+ this.sendToMainWorker({
+ ready: true,
+ taskFunctionsProperties: this.listTaskFunctionsProperties(),
+ })
+ } catch {
+ this.sendToMainWorker({
+ ready: false,
+ taskFunctionsProperties: this.listTaskFunctionsProperties(),
+ })
+ }