Skip to content

Commit

Permalink
comment out timelimit
Browse files Browse the repository at this point in the history
  • Loading branch information
c3wenjiaowang committed Jun 27, 2023
1 parent 1c9d690 commit 3a6e6a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions lib/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.`);
Expand Down

0 comments on commit 3a6e6a1

Please sign in to comment.