Files
go-admin/common
zhangwenjian ea2d807071 fix🐛: give queries the request's context, not the pooled gin.Context
WithContextDb and the five CRUD actions passed the *gin.Context itself
to GORM as the query's context. database/sql watches the context of a
query that returns rows inside a transaction from a goroutine of its
own, which can still read it after the handler returns - and gin hands
that Context to the next request as soon as the handler returns. GORM
wraps every write in a transaction, and an INSERT on SQLite or
PostgreSQL returns the new key as a row, so any write raced with the
next request's reset. The race detector reports it on the second of
two sequential requests.

They now pass c.Request.Context(), which belongs to one request only
and is cancelled when its client goes away.
2026-09-27 20:45:45 +08:00
..
2026-08-23 13:26:46 +08:00
2026-09-18 18:55:19 +08:00
2023-08-01 22:38:41 +08:00
2026-08-23 13:26:46 +08:00