From 582352e23315c9fcff469450d4a36d01f199149d Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Tue, 5 Sep 2023 17:33:47 +0100 Subject: [PATCH] fix: Fix Wallet Reward Computing Job - MEED-2455 Prior to this fix, the Wallet Rewarding Job is sometimes executed at the same time then the rewards sending. This change ensure to not asynchronously sompute rewards at the same time than executing a Reward Period Sending storage operation. --- .../wallet/reward/service/WalletRewardReportService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wallet-reward-services/src/main/java/org/exoplatform/wallet/reward/service/WalletRewardReportService.java b/wallet-reward-services/src/main/java/org/exoplatform/wallet/reward/service/WalletRewardReportService.java index f6a670c68..5a47ba2a6 100644 --- a/wallet-reward-services/src/main/java/org/exoplatform/wallet/reward/service/WalletRewardReportService.java +++ b/wallet-reward-services/src/main/java/org/exoplatform/wallet/reward/service/WalletRewardReportService.java @@ -235,7 +235,7 @@ public RewardReport computeRewardsByUser(LocalDate date, long userIdentityId) { public RewardReport getRewardReportByPeriodId(long periodId) { RewardSettings rewardSettings = rewardSettingsService.getSettings(); if (rewardSettings == null) { - throw new IllegalStateException("Error computing rewards using empty settings"); + throw new IllegalStateException(EMPTY_SETTINGS); } if (rewardSettings.getPeriodType() == null) { throw new IllegalStateException("Error computing rewards using empty period type"); @@ -263,7 +263,7 @@ public RewardReport getRewardReport(LocalDate date) { public RewardPeriod getRewardPeriod(RewardPeriodType periodType, LocalDate date) { RewardSettings rewardSettings = rewardSettingsService.getSettings(); if (rewardSettings == null) { - throw new IllegalStateException("Error computing rewards using empty settings"); + throw new IllegalStateException(EMPTY_SETTINGS); } return rewardReportStorage.getRewardPeriod(periodType, date, rewardSettings.zoneId()); }