Skip to content

Commit

Permalink
fix: Fix Wallet Reward Computing Job - MEED-2455
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
boubaker authored and exo-swf committed Sep 7, 2023
1 parent 93775f6 commit 582352e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit 582352e

Please sign in to comment.