@tolgee/cli 2.3.1 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extractor/worker.js +3 -2
- package/package.json +1 -1
package/dist/extractor/worker.js
CHANGED
@@ -5,6 +5,7 @@ import { readFile } from 'fs/promises';
|
|
5
5
|
import internalExtractor from './extractor.js';
|
6
6
|
import { loadModule } from '../utils/moduleLoader.js';
|
7
7
|
import { createDeferred } from '../utils/deferred.js';
|
8
|
+
const FILE_TIME_LIMIT = 60 * 1000; // one minute
|
8
9
|
const IS_TS_NODE = extname(import.meta.url) === '.ts';
|
9
10
|
// --- Worker functions
|
10
11
|
let loadedExtractor = Symbol('unloaded');
|
@@ -54,8 +55,8 @@ function createWorker() {
|
|
54
55
|
currentDeferred = job[1];
|
55
56
|
timeout = setTimeout(() => {
|
56
57
|
worker.terminate();
|
57
|
-
currentDeferred.reject(new Error(
|
58
|
-
},
|
58
|
+
currentDeferred.reject(new Error(`Time limit for parsing ${job[0].file} exceeded`));
|
59
|
+
}, FILE_TIME_LIMIT);
|
59
60
|
}
|
60
61
|
worker.on('message', (msg) => {
|
61
62
|
if ('data' in msg) {
|