1 parent
586f2bca19
commit
7114e9ed4a
13 files changed
+587
-10
No files matched your search
@@ -0,0 +1,14 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// recoveryRequestContext 保留请求的取消信号;兼容无 HTTP 请求的内部调用。
|
||||
func recoveryRequestContext(req *http.Request) context.Context {
|
||||
if req == nil {
|
||||
return context.Background()
|
||||
}
|
||||
return req.Context()
|
||||
}
|
||||
Reference in new issue
Block a user