mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-10 13:21:53 +01:00
Fix UpgradeTool execution log (#3614)
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>
This commit is contained in:
parent
55d6d21f1f
commit
6eb49577fe
@ -78,7 +78,8 @@ public class Upgrader {
|
|||||||
logger.error("Cannot access item database '{}', check path and access rights.", itemJsonDatabasePath);
|
logger.error("Cannot access item database '{}', check path and access rights.", itemJsonDatabasePath);
|
||||||
return;
|
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.",
|
logger.error("Cannot access metadata database '{}', check path and access rights.",
|
||||||
metadataJsonDatabasePath);
|
metadataJsonDatabasePath);
|
||||||
return;
|
return;
|
||||||
@ -164,10 +165,10 @@ public class Upgrader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class UpgradeRecord {
|
private static class UpgradeRecord {
|
||||||
public final ZonedDateTime executionDate;
|
public final String executionDate;
|
||||||
|
|
||||||
public UpgradeRecord(ZonedDateTime executionDate) {
|
public UpgradeRecord(ZonedDateTime executionDate) {
|
||||||
this.executionDate = executionDate;
|
this.executionDate = executionDate.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user