修正:利用context.Timeout,appsrv支持processTimeout,避免yunionapi由于后端卡住导致yunionapi卡住

This commit is contained in:
Qiu Jian
2018-10-20 22:32:43 +08:00
parent d117e5eb3e
commit 0dbc93725d
4 changed files with 126 additions and 87 deletions
+5
View File
@@ -185,6 +185,11 @@ func NewRequireLicenseError(msg string, params ...interface{}) *httputils.JSONCl
return NewJsonClientError(402, "RequireLicenseError", msg, err)
}
func NewTimeoutError(msg string, params ...interface{}) *httputils.JSONClientError {
msg, err := errorMessage(msg, params...)
return NewJsonClientError(504, "TimeoutError", msg, err)
}
func NewGeneralError(err error) *httputils.JSONClientError {
switch err.(type) {
case *httputils.JSONClientError: