Refactor change_falukant_user_money: Remove debug logging for money clamping and update execution to reduce noise, maintaining essential logging only when clipping occurs.

This commit is contained in:
Torsten Schulz (local)
2025-12-09 10:35:33 +01:00
parent c801e50def
commit cddf701af1

View File

@@ -178,12 +178,7 @@ impl BaseWorker {
// numeric(10,2) allows values with absolute < 10^8 (100_000_000)
const MAX_ABS: f64 = 100_000_000.0 - 0.01; // leave room for scale
let allowed = MAX_ABS - current_money;
eprintln!(
"[BaseWorker] money clamp debug: current_money={}, money_change={}, tentative={}, allowed_max_delta={}",
current_money, money_change, tentative, allowed
);
let _allowed = MAX_ABS - current_money;
let adjusted_money_change = if tentative >= MAX_ABS {
let clipped = MAX_ABS - current_money;
@@ -203,10 +198,7 @@ impl BaseWorker {
money_change
};
eprintln!(
"[BaseWorker] money clamp debug result: adjusted_money_change={}",
adjusted_money_change
);
// Keep only important clamp logging: when clipping occurs we log it above.
// Send exact types matching the DB function signature:
let uid_i32: i32 = falukant_user_id;
@@ -215,10 +207,7 @@ impl BaseWorker {
// Note: we intentionally avoid parameterized call due to serialization
// issues in this environment and instead execute a literal SQL below.
eprintln!(
"[BaseWorker] change_falukant_user_money: executing literal update_money(user_id={}, money_change='{}', action={})",
uid_i32, money_str, action
);
// Execute update; avoid noisy logging here.
// Use a literal SQL call because parameterized execution keeps failing
// with "error serializing parameter 1" in this environment.