diff --git a/.github/workflows/gf.yml b/.github/workflows/gf.yml index a85a987a2..021406941 100644 --- a/.github/workflows/gf.yml +++ b/.github/workflows/gf.yml @@ -66,7 +66,9 @@ jobs: - 3306:3306 # PostgreSQL backend server. - # docker run -d --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=12345678 -e POSTGRES_USER=postgres -e POSTGRES_DB=test -v postgres:/Users/john/Temp/postgresql/data loads/postgres:13 + # docker run -d --name postgres -p 5432:5432 \ + # -e POSTGRES_PASSWORD=12345678 -e POSTGRES_USER=postgres -e POSTGRES_DB=test \ + # -v postgres:/Users/john/Temp/postgresql/data loads/postgres:13 postgres: image: loads/postgres:13 env: @@ -84,6 +86,13 @@ jobs: --health-retries 5 # MSSQL backend server. + # docker run -d --name mssql -p 1433:1433 \ + # -e ACCEPT_EULA=Y \ + # -e SA_PASSWORD=LoremIpsum86 \ + # -e MSSQL_DB=test \ + # -e MSSQL_USER=root \ + # -e MSSQL_PASSWORD=LoremIpsum86 \ + # loads/mssqldocker:14.0.3391.2 mssql: image: loads/mssqldocker:14.0.3391.2 env: diff --git a/net/ghttp/ghttp_request_param_ctx.go b/net/ghttp/ghttp_request_param_ctx.go index b7d0a4e5c..aae38f7be 100644 --- a/net/ghttp/ghttp_request_param_ctx.go +++ b/net/ghttp/ghttp_request_param_ctx.go @@ -26,10 +26,7 @@ func RequestFromCtx(ctx context.Context) *Request { // See GetCtx. func (r *Request) Context() context.Context { if r.context == nil { - // DO NOT use the http context as it will be canceled after request done, - // which makes the asynchronous goroutine encounter "context canceled" error. - // r.context = r.Request.Context() - r.context = gctx.New() + r.context = gctx.WithCtx(r.Request.Context()) } // Inject Request object into context. if RequestFromCtx(r.context) == nil {