Skip to content

Commit 74eb094

Browse files
committed
Use more performant writer for all json repositories
1 parent f2d09a7 commit 74eb094

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

platform_api/src/main/java/net/modfest/platform/repository/AbstractJsonRepository.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ public void save(@NonNull Data newData) {
109109
validateEdit(prev, newData);
110110

111111
// Write data to json file first
112-
this.root.write(p -> {
113-
this.jsonUtil.writeJson(p.resolve(getLocation(newData)), newData);
112+
this.root.writePerformant((p, logger) -> {
113+
var newLocation = p.resolve(getLocation(newData));
114+
this.jsonUtil.writeJson(newLocation, newData);
115+
logger.logWrite(newLocation);
114116
});
115117

116118
// Keep our in-memory storage up to date

0 commit comments

Comments
 (0)