Skip to content

Commit

Permalink
Merge pull request #446 from opexdev/hot-fix_fi-retry
Browse files Browse the repository at this point in the history
Fix wallet amount condition and fi status when giving up
  • Loading branch information
Marchosiax authored Jun 2, 2024
2 parents fd49c92 + b153906 commit a098e97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,15 @@ class FinancialActionPersisterImpl(
//Do nothing
} else {
with(retryModel) {
val giveUp = retries + 1 >= retryCount
faRetryRepository.scheduleNext(
id!!,
retries + 1,
LocalDateTime.now().plusSeconds(retries * delayMultiplier * delaySeconds),
retries >= retryCount
giveUp
).awaitSingleOrNull()

if (hasGivenUp)
if (giveUp)
status = FinancialActionStatus.ERROR
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class WalletManagerImpl(
}

override suspend fun isWithdrawAllowed(wallet: Wallet, amount: BigDecimal): Boolean {
if (amount <= BigDecimal.ZERO)
if (amount < BigDecimal.ZERO)
throw OpexError.InvalidAmount.exception()

var evaluate = wallet.balance.amount >= amount
Expand Down

0 comments on commit a098e97

Please sign in to comment.