This commit is contained in:
Pierre
2025-12-31 16:16:32 +01:00
parent a2ac04563e
commit 08c7479a1a
3 changed files with 2344 additions and 0 deletions
+1
View File
@@ -28,3 +28,4 @@ yarn-error.log*
/dist/ /dist/
.idea .idea
build build
.pnpm-store/
+2341
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -48,6 +48,8 @@ export class HashIndexManager {
public async init(autosave = true) { public async init(autosave = true) {
if (!this.initialLoad) { if (!this.initialLoad) {
this.initialLoad = new Promise<void>(async (resolve, reject) => { this.initialLoad = new Promise<void>(async (resolve, reject) => {
// Create the index folder if it doesn't exist
await fs.mkdir(this.indexFolderPath, { recursive: true });
const stat = await fs.stat(this.indexFolderPath); const stat = await fs.stat(this.indexFolderPath);
if (!stat.isDirectory()) { if (!stat.isDirectory()) {
throw new Error(`Invalid index folder path ${this.indexFolderPath}`); throw new Error(`Invalid index folder path ${this.indexFolderPath}`);