15249 sync.pool (#16103)
* use sync.pool for session * added back to sync pool * reverted change * added a new line * added back session object * added back session object * added back session object * revert * refactored into function * added the session object back into the pool * work in progress * work in progress * work in progress * code review comments Co-authored-by: Arjuna Marambe <arjunam@buildxact.com> Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7f8850398c
Коммит
5f16fc644a
@@ -191,6 +191,8 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if token != "" && tokenLocation != app.TokenLocationCloudHeader {
|
||||
session, err := c.App.GetSession(token)
|
||||
defer app.ReturnSessionToPool(session)
|
||||
|
||||
if err != nil {
|
||||
c.Logger.Info("Invalid session", mlog.Err(err))
|
||||
if err.StatusCode == http.StatusInternalServerError {
|
||||
|
||||
Ссылка в новой задаче
Block a user