gitnexus 1.6.6-rc.11 → 1.6.6-rc.12
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/server/api.js +12 -4
- package/package.json +1 -1
package/dist/server/api.js
CHANGED
|
@@ -890,7 +890,13 @@ export const createServer = async (port, host = '127.0.0.1') => {
|
|
|
890
890
|
res.once('finish', markFinished);
|
|
891
891
|
res.once('close', abortStreaming);
|
|
892
892
|
try {
|
|
893
|
-
|
|
893
|
+
// Read-only open: /api/graph never writes. Write-mode opens engage
|
|
894
|
+
// LadybugDB's checkpoint machinery (`.shadow` sidecar), which on
|
|
895
|
+
// Windows races with the OS file handle release and trips
|
|
896
|
+
// "Cannot open file ... lbug.shadow - Error 2". See pool-adapter.ts
|
|
897
|
+
// which already opens read-only for the same reason, and the
|
|
898
|
+
// /api/query precedent in PR #1655.
|
|
899
|
+
await withLbugDb(lbugPath, async () => streamGraphNdjson(res, includeContent, abortController.signal), { readOnly: true });
|
|
894
900
|
if (!abortController.signal.aborted && !res.writableEnded) {
|
|
895
901
|
res.end();
|
|
896
902
|
}
|
|
@@ -902,7 +908,9 @@ export const createServer = async (port, host = '127.0.0.1') => {
|
|
|
902
908
|
}
|
|
903
909
|
return;
|
|
904
910
|
}
|
|
905
|
-
const graph = await withLbugDb(lbugPath, async () => buildGraph(includeContent)
|
|
911
|
+
const graph = await withLbugDb(lbugPath, async () => buildGraph(includeContent), {
|
|
912
|
+
readOnly: true,
|
|
913
|
+
});
|
|
906
914
|
res.json(graph);
|
|
907
915
|
}
|
|
908
916
|
catch (err) {
|
|
@@ -1051,7 +1059,7 @@ export const createServer = async (port, host = '127.0.0.1') => {
|
|
|
1051
1059
|
return { ...r, ...enrichment };
|
|
1052
1060
|
}));
|
|
1053
1061
|
return { searchResults: enriched, ftsAvailable };
|
|
1054
|
-
});
|
|
1062
|
+
}, { readOnly: true });
|
|
1055
1063
|
const response = { results: results.searchResults ?? results };
|
|
1056
1064
|
if (results.ftsAvailable === false) {
|
|
1057
1065
|
response.warning =
|
|
@@ -1125,7 +1133,7 @@ export const createServer = async (port, host = '127.0.0.1') => {
|
|
|
1125
1133
|
const repoRoot = path.resolve(entry.path);
|
|
1126
1134
|
// Get file paths from the graph (lightweight — no content loaded)
|
|
1127
1135
|
const lbugPath = path.join(entry.storagePath, 'lbug');
|
|
1128
|
-
const fileRows = await withLbugDb(lbugPath, () => executeQuery(`MATCH (n:File) WHERE n.content IS NOT NULL RETURN n.filePath AS filePath`));
|
|
1136
|
+
const fileRows = await withLbugDb(lbugPath, () => executeQuery(`MATCH (n:File) WHERE n.content IS NOT NULL RETURN n.filePath AS filePath`), { readOnly: true });
|
|
1129
1137
|
// Search files on disk one at a time (constant memory)
|
|
1130
1138
|
for (const row of fileRows) {
|
|
1131
1139
|
if (results.length >= limit)
|
package/package.json
CHANGED