Skip to content

Commit

Permalink
Fix UpgradeTool execution log (#3614)
Browse files Browse the repository at this point in the history
It seems that in some cases GSON is not able to correctly serialize/deserialize ZonedDateTime. Since we do not depend on the value in any case (it's just informational), we can store a String instead.

A missing metadata database also failed the check when upgrading items. This has been fixed, too.

Signed-off-by: Jan N. Klug <github@klug.nrw>
  • Loading branch information
J-N-K authored May 14, 2023
1 parent 55d6d21 commit 6eb4957
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public void itemCopyUnitToMetadata() {
logger.error("Cannot access item database '{}', check path and access rights.", itemJsonDatabasePath);
return;
}
if (!Files.isWritable(metadataJsonDatabasePath)) {
// missing metadata database is also fine, we create one in that case
if (!Files.isWritable(metadataJsonDatabasePath) && Files.exists(metadataJsonDatabasePath)) {
logger.error("Cannot access metadata database '{}', check path and access rights.",
metadataJsonDatabasePath);
return;
Expand Down Expand Up @@ -164,10 +165,10 @@ public void linkUpgradeJsProfile() {
}

private static class UpgradeRecord {
public final ZonedDateTime executionDate;
public final String executionDate;

public UpgradeRecord(ZonedDateTime executionDate) {
this.executionDate = executionDate;
this.executionDate = executionDate.toString();
}
}
}

0 comments on commit 6eb4957

Please sign in to comment.