mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-05-06 14:24:15 +02:00
fix(gacha): log and skip gacha_items rows that fail to scan
Previously GetItemsForEntry/GetGuaranteedItems silently swallowed StructScan errors, so misconfigured rows (item_type > 255 or item_id/quantity > 65535) disappeared from rewards with no trace, making config bugs hard to diagnose without a DB dump. Pass a zap.Logger into GachaRepository and emit a Warn pointing at the likely cause and the offending entry/gacha ID.
This commit is contained in:
@@ -333,7 +333,7 @@ func SetTestDB(s *Server, db *sqlx.DB) {
|
||||
s.charRepo = NewCharacterRepository(db)
|
||||
s.guildRepo = NewGuildRepository(db)
|
||||
s.userRepo = NewUserRepository(db)
|
||||
s.gachaRepo = NewGachaRepository(db)
|
||||
s.gachaRepo = NewGachaRepository(db, nil)
|
||||
s.houseRepo = NewHouseRepository(db)
|
||||
s.festaRepo = NewFestaRepository(db)
|
||||
s.towerRepo = NewTowerRepository(db)
|
||||
|
||||
Reference in New Issue
Block a user