mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-21 23:22:34 +01:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user