Skip to content

Commit

Permalink
fix(db): fix leveldb manifest rewrite.
Browse files Browse the repository at this point in the history
1. do not generate engine.properties if it is not a db path
  • Loading branch information
halibobo1205 committed Sep 19, 2022
1 parent e09095c commit 13eb9a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions plugins/src/main/java/org/tron/plugins/ArchiveManifest.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,14 @@ public boolean doArchive() throws IOException {
logger.info("File {},does not exist, ignored.", srcDbPath.toString());
return true;
}
if (!checkEngine()) {
logger.info("Db {},not leveldb, ignored.", this.name);
return true;
}
if (!checkManifest(levelDbFile.toString())) {
logger.info("Db {},no need, ignored.", levelDbFile.toString());
return true;
}
if (!checkEngine()) {
logger.info("Db {},not leveldb, ignored.", this.name);
return true;
}
open();
logger.info("Db {} archive use {} ms.", this.name, (System.currentTimeMillis() - startTime));
return true;
Expand Down
8 changes: 4 additions & 4 deletions plugins/src/main/java/org/tron/plugins/DbArchive.java
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ public void doArchive() {
logger.info("File {},does not exist, ignored.", srcDbPath);
return;
}
if (!checkEngine()) {
logger.info("Db {},not leveldb, ignored.", this.name);
return;
}
try {
if (checkManifest(levelDbFile.toString())) {
if (!checkEngine()) {
logger.info("Db {},not leveldb, ignored.", this.name);
return;
}
open();
logger.info("Db {} archive use {} ms.", this.name,
(System.currentTimeMillis() - startTime));
Expand Down

0 comments on commit 13eb9a3

Please sign in to comment.