refactor(channelserver): eliminate *sql.Rows from EventRepo.GetEventQuests

Return []EventQuest instead of a raw database cursor, removing the last
*sql.Rows leak from the repository layer. The handler now iterates a
slice, and makeEventQuest reads fields from the struct directly instead
of scanning rows twice. This makes the method fully mockable and
eliminates the risk of unclosed cursors.
This commit is contained in:
Houmgaor
2026-02-21 14:37:29 +01:00
parent f2f5696a22
commit bd8e30d570
4 changed files with 66 additions and 78 deletions

View File

@@ -271,7 +271,7 @@ type EventRepo interface {
GetLoginBoosts(charID uint32) ([]loginBoost, error)
InsertLoginBoost(charID uint32, weekReq uint8, expiration, reset time.Time) error
UpdateLoginBoost(charID uint32, weekReq uint8, expiration, reset time.Time) error
GetEventQuests() (*sql.Rows, error)
GetEventQuests() ([]EventQuest, error)
UpdateEventQuestStartTime(tx *sql.Tx, id uint32, startTime time.Time) error
BeginTx() (*sql.Tx, error)
}