fix send error

This commit is contained in:
boufni95 2025-05-07 16:23:39 +00:00
parent bb19a30c6d
commit 089fafb072
2 changed files with 13 additions and 4 deletions

View file

@ -494,9 +494,13 @@ class StorageProcessor {
private sendResponse(response: OperationResponse<any>) {
try {
if (process.send) {
process.send(response);
process.send(response, undefined, undefined, err => {
if (err) {
console.error("failed to send response to main process from storage processor, killing sub process")
process.exit(1)
}
});
}
} catch (error) {
console.error("failed to send response to main process from storage processor, killing sub process")

View file

@ -106,7 +106,7 @@ class TlvFilesStorageProcessor {
});
process.on('error', (error: Error) => {
console.error('Error in storage processor:', error);
console.error('Error in tlv files storage processor:', error);
});
this.wrtc = new webRTC(t => {
@ -358,7 +358,12 @@ class TlvFilesStorageProcessor {
private sendResponse<T>(response: TlvOperationResponse<T>) {
try {
if (process.send) {
process.send(response);
process.send(response, undefined, undefined, err => {
if (err) {
console.error("failed to send response to main process from tlv files storage processor, killing sub process")
process.exit(1)
}
});
}
} catch (error) {
console.error("failed to send response to main process from tlv files storage processor, killing sub process")