From 3a6e6a1cf76666e0b3e78d14d3bcff9a258a9f2a Mon Sep 17 00:00:00 2001 From: "wenjiao.wang@c3iot.com" Date: Mon, 26 Jun 2023 19:54:39 -0700 Subject: [PATCH] comment out timelimit --- lib/index.js | 6 +++--- lib/worker.js | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/index.js b/lib/index.js index 2dcf47e..5857a73 100644 --- a/lib/index.js +++ b/lib/index.js @@ -61,9 +61,9 @@ function responseFileReadyForReading(filePath) { function readResponseFile(filePath) { const startTime = Date.now(); while (!responseFileReadyForReading(filePath)) { - if (timeLimitExceeded(startTime)) { - throw new Error("Response file waiting to read for > 30s in main thread in sync-rpc."); - } + // if (timeLimitExceeded(startTime)) { + // throw new Error("Response file waiting to read for > 30s in main thread in sync-rpc."); + // } } const res = fs.readFileSync(filePath); fs.unlinkSync(filePath); diff --git a/lib/worker.js b/lib/worker.js index 06b086c..6f4a654 100644 --- a/lib/worker.js +++ b/lib/worker.js @@ -18,10 +18,10 @@ function timeLimitExceeded(startTime) { function writeResponseToFile(filePath, response) { const startTime = Date.now(); while (!responseFileReadyForWriting(filePath)) { - if (timeLimitExceeded(startTime)) { - fs.unlinkSync(filePath); - writeResponseToFile(filePath, JSON.stringify({s: false, v: {code: -1, message: "Response file waiting to write for > 30s in worker thread in sync-rpc."}})); - } + // if (timeLimitExceeded(startTime)) { + // fs.unlinkSync(filePath); + // writeResponseToFile(filePath, JSON.stringify({s: false, v: {code: -1, message: "Response file waiting to write for > 30s in worker thread in sync-rpc."}})); + // } } fs.writeFileSync(filePath, response); debugMode && console.log(`Written response to file.`);