gin icon indicating copy to clipboard operation
gin copied to clipboard

fix: gin Context check nil engine

Open weedge opened this issue 1 year ago • 0 comments

https://github.com/golang/go/blob/release-branch.go1.16/src/database/sql/sql.go#L1205 image https://github.com/gin-gonic/gin/blob/v1.8.1/context.go#L1168 image https://github.com/gin-gonic/gin/blob/v1.7.1/context.go#L1157 image

use gin.Context{} to database conn ctx param, if use v1.8.1 c.engine =nil panic then recover, un free lock conn; next time to conn lock, always wait lock to free; if use v1.7.* is ok; so gin cxt.Done() to check e.engine=nil, Compatible with this case.

weedge avatar Aug 17 '22 16:08 weedge