Skip to content

Commit

Permalink
Explicitly call flush after putting value into CustomDataStorage
Browse files Browse the repository at this point in the history
This ensures the value is immediately written to disk.
  • Loading branch information
etiennestuder committed Mar 20, 2020
1 parent c0d38e7 commit ddcc7d2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public void mark(SBuild build) {

if (existing == null) {
customDataStorage.putValue(buildId, "");
customDataStorage.flush();
}
}

Expand All @@ -33,11 +34,13 @@ public void store(SBuild build, String buildScanUrl) {

if (existing == null || existing.isEmpty()) {
customDataStorage.putValue(buildId, buildScanUrl);
customDataStorage.flush();
} else {
List<String> scans = StringUtil.split(existing, BUILD_SCAN_URLS_SEPARATOR);
scans.add(buildScanUrl);

customDataStorage.putValue(buildId, StringUtil.join(BUILD_SCAN_URLS_SEPARATOR, scans));
customDataStorage.flush();
}
}

Expand Down

0 comments on commit ddcc7d2

Please sign in to comment.