Skip to content

Commit

Permalink
reset db on unable to read privatekey
Browse files Browse the repository at this point in the history
  • Loading branch information
dominusmars committed Mar 5, 2024
1 parent a281f50 commit bb4bd51
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/db/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,12 @@ class DataBase {
process.exit(1);
}
if (trials <= 10) {
console.log("new Level");
this.backupDB = new Level(this.backupDir);
this.db = new Level(this.filePath);
}
try {
await delay(1000);
await delay(500);
this.checkAndCreateDB();
this.initAndCreateBackUpDB();
try {
Expand Down Expand Up @@ -214,8 +215,9 @@ class DataBase {
}
this.log.log((error as string) + " Unable to init DB");
await delay(500);
await this._resetDB();
trials = trials - 1;
await this.initDB(trials);
return await this.initDB(trials);
}
}

Expand Down

0 comments on commit bb4bd51

Please sign in to comment.