Skip to content

Commit

Permalink
Исправление ошибки в миграции конфига
Browse files Browse the repository at this point in the history
  • Loading branch information
YanSergey committed May 9, 2024
1 parent c4989ff commit 816e1d5
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ public void init() {
/** Миграция настроек из конфига предыдущей версии. */
public void migrateProps() {

if (configVersion == null) {
configVersion = "0.2.0";
servers.forEach((key, server) -> server.migrateProps(configVersion));
}

if (!currentVersion.toString().equals(configVersion)) {
// делаем бекап конфига
String configCopy = configPath + "_bak";
Expand All @@ -230,14 +235,9 @@ public void migrateProps() {
LOGGER.error("Config file backup error:", e);
}
}
configVersion = currentVersion.toString();
}

if (configVersion == null) {
configVersion = "0.2.0";
servers.forEach((key, server) -> server.migrateProps(configVersion));
configVersion = currentVersion.toString();
}
configVersion = currentVersion.toString();
}

private OsType getOperatingSystemType() {
Expand Down

0 comments on commit 816e1d5

Please sign in to comment.