Skip to content

Commit

Permalink
feat: Updated src/main/java/com/yuriytkach/tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] authored Dec 16, 2023
1 parent ceebaf0 commit 0a80a91
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import com.yuriytkach.tracker.fundraiser.model.Fund;
import com.yuriytkach.tracker.fundraiser.model.SlackResponse;
import com.yuriytkach.tracker.fundraiser.model.exception.DuplicateFundException;
import com.yuriytkach.tracker.fundraiser.model.exception.FundTotalMismatchException;
import com.yuriytkach.tracker.fundraiser.model.exception.FundClosedException;
import com.yuriytkach.tracker.fundraiser.model.exception.FundNotFoundException;
import com.yuriytkach.tracker.fundraiser.model.exception.FundNotOwnedException;
Expand Down Expand Up @@ -173,7 +174,15 @@ private SlackResponse processTrackCommand(final Matcher matcher, final String us
throw FundClosedException.withFundAndMessage(fund, "Can't track donations");
}

final Fund updatedFund = donationTracker.trackDonation(fund, donation);
Fund updatedFund;
while (true) {
try {
updatedFund = donationTracker.trackDonation(fund, donation);
break;
} catch (FundTotalMismatchException e) {

Check notice on line 182 in src/main/java/com/yuriytkach/tracker/fundraiser/service/TrackService.java

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

src/main/java/com/yuriytkach/tracker/fundraiser/service/TrackService.java#L182

Name 'e' must match pattern '^(ex|[a-z][a-z][a-zA-Z]+)$'.
log.warn("Fund total mismatch when tracking donation, retrying...");
}
}

return createSuccessResponse(
null,
Expand Down

0 comments on commit 0a80a91

Please sign in to comment.