Skip to content

Commit

Permalink
Fix direct memory issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ystxn committed Jul 28, 2024
1 parent dcb85e5 commit 07c0086
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ jacocoTestReport {

bootBuildImage {
pullPolicy = "IF_NOT_PRESENT"
environment = [
"BP_JVM_VERSION": "22",
"BPE_DELIM_JAVA_TOOL_OPTIONS": " ",
"BPE_APPEND_JAVA_TOOL_OPTIONS": " -XX:MaxDirectMemorySize=200M"
]
docker {
publishRegistry {
username = "$System.env.DOCKER_USER"
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/tech/sledger/service/TransactionService.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private <T extends Transaction> List<T> processDates(List<T> transactions, long
// Get existing transactions in range
List<Transaction> existing = txRepo.findAllByAccountIdAndDateBetween(accountId, rangeAfter, rangeBefore);

log.info("Existing dates between {} and {}: {}", rangeAfter, rangeBefore, existing.stream().map(Transaction::getDate).toList());
log.debug("Existing dates between {} and {}: {}", rangeAfter, rangeBefore, existing.stream().map(Transaction::getDate).toList());

long id = idEpoch;
transactions = new ArrayList<>(transactions);
Expand All @@ -87,9 +87,9 @@ private <T extends Transaction> List<T> processDates(List<T> transactions, long
.map(Transaction::getDate).orElse(null);
if (existingDate != null) {
targetDate = existingDate.plus(1L, ChronoUnit.SECONDS);
log.info("Updated date to: {}", targetDate);
log.debug("Updated date to: {}", targetDate);
} else {
log.info("No existing date found. Maintain {}", targetDate);
log.debug("No existing date found. Maintain {}", targetDate);
}
transaction.setDate(targetDate);
existing.add(transaction);
Expand Down

0 comments on commit 07c0086

Please sign in to comment.