mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[performance] cached oauth database types (#2838)
* update token + client code to use struct caches * add code comments * slight tweak to default mem ratios * fix envparsing * add appropriate invalidate hooks * update the tokenstore sweeping function to rely on caches * update to use PutClient() * add ClientID to list of token struct indices
This commit is contained in:
@ -49,7 +49,7 @@ func (m *Module) TokenPOSTHandler(c *gin.Context) {
|
||||
|
||||
form := &tokenRequestForm{}
|
||||
if err := c.ShouldBind(form); err != nil {
|
||||
apiutil.OAuthErrorHandler(c, gtserror.NewErrorBadRequest(oauth.InvalidRequest(), err.Error()))
|
||||
apiutil.OAuthErrorHandler(c, gtserror.NewErrorBadRequest(oauth.ErrInvalidRequest, err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ func (m *Module) TokenPOSTHandler(c *gin.Context) {
|
||||
}
|
||||
|
||||
if len(help) != 0 {
|
||||
apiutil.OAuthErrorHandler(c, gtserror.NewErrorBadRequest(oauth.InvalidRequest(), help...))
|
||||
apiutil.OAuthErrorHandler(c, gtserror.NewErrorBadRequest(oauth.ErrInvalidRequest, help...))
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user