mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-28 23:02:25 -05:00
[performance] Speed up some of the slower db queries (#523)
* remove unnecessary LOWER() db calls * warn during slow db queries * use bundb built-in exists function * add db block test * update account block query * add domain block db test * optimize domain block query * fix implementing wrong test * exclude most columns when checking block * go fmt * remote more unnecessary use of LOWER()
This commit is contained in:
parent
faae2505c0
commit
a5852fd7e4
13 changed files with 151 additions and 29 deletions
|
|
@ -36,14 +36,16 @@ func (m *Module) threadTemplateHandler(c *gin.Context) {
|
|||
|
||||
ctx := c.Request.Context()
|
||||
|
||||
username := c.Param(usernameKey)
|
||||
// usernames on our instance will always be lowercase
|
||||
username := strings.ToLower(c.Param(usernameKey))
|
||||
if username == "" {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "no account username specified"})
|
||||
return
|
||||
}
|
||||
|
||||
statusID := c.Param(statusIDKey)
|
||||
if username == "" {
|
||||
// status ids will always be uppercase
|
||||
statusID := strings.ToUpper(c.Param(statusIDKey))
|
||||
if statusID == "" {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": "no status id specified"})
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue