Revert decimal rounding order, fix profile settings (#4314)

* Revert rounding post subtraction in GET balance

* Switch to panic = "unwind" in release mode

* Use profile 'release-labrinth'

* Fix target path
This commit is contained in:
François-Xavier Talbot
2025-09-01 15:59:09 +01:00
committed by GitHub
parent 3d80201112
commit 8aede4e082
3 changed files with 10 additions and 3 deletions

View File

@@ -8,13 +8,13 @@ ARG GIT_HASH
RUN --mount=type=cache,target=/usr/src/labrinth/target \
--mount=type=cache,target=/usr/local/cargo/git/db \
--mount=type=cache,target=/usr/local/cargo/registry \
SQLX_OFFLINE=true cargo build --release --package labrinth
SQLX_OFFLINE=true cargo build --profile release-labrinth --package labrinth
FROM build AS artifacts
RUN --mount=type=cache,target=/usr/src/labrinth/target \
mkdir /labrinth \
&& cp /usr/src/labrinth/target/release/labrinth /labrinth/labrinth \
&& cp /usr/src/labrinth/target/release-labrinth/labrinth /labrinth/labrinth \
&& cp -r /usr/src/labrinth/apps/labrinth/migrations /labrinth \
&& cp -r /usr/src/labrinth/apps/labrinth/assets /labrinth

View File

@@ -1028,7 +1028,9 @@ async fn get_user_balance(
});
Ok(UserBalance {
available: (available - withdrawn - fees).round_dp(16),
available: available.round_dp(16)
- withdrawn.round_dp(16)
- fees.round_dp(16),
withdrawn_lifetime: withdrawn.round_dp(16),
withdrawn_ytd: withdrawn_this_year.round_dp(16),
pending,