openairev 0.3.8 → 0.3.9
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/package.json +1 -1
- package/src/cli/wait.js +10 -0
package/package.json
CHANGED
package/src/cli/wait.js
CHANGED
|
@@ -5,6 +5,12 @@ import { getConfigDir } from '../config/config-loader.js';
|
|
|
5
5
|
export async function waitCommand(options) {
|
|
6
6
|
const progressFile = options.file || join(getConfigDir(), 'progress.json');
|
|
7
7
|
|
|
8
|
+
// Wait up to 30s for the progress file to appear (race with MCP server)
|
|
9
|
+
let waited = 0;
|
|
10
|
+
while (!existsSync(progressFile) && waited < 30_000) {
|
|
11
|
+
await sleep(1000);
|
|
12
|
+
waited += 1000;
|
|
13
|
+
}
|
|
8
14
|
if (!existsSync(progressFile)) {
|
|
9
15
|
console.log('No review in progress. Call openairev_review first.');
|
|
10
16
|
process.exit(1);
|
|
@@ -32,6 +38,10 @@ export async function waitCommand(options) {
|
|
|
32
38
|
});
|
|
33
39
|
}
|
|
34
40
|
|
|
41
|
+
function sleep(ms) {
|
|
42
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
43
|
+
}
|
|
44
|
+
|
|
35
45
|
function readProgress(path) {
|
|
36
46
|
try {
|
|
37
47
|
return JSON.parse(readFileSync(path, 'utf-8'));
|