summaryrefslogtreecommitdiff
path: root/internal/db/bundb/admin.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-10-03 10:46:11 +0200
committerLibravatar GitHub <noreply@github.com>2022-10-03 10:46:11 +0200
commit56f53a2a6f85876485e2ae67d48b78b448caed6e (patch)
tree9bd8d3fcaffd515d3dc90ff22c6cee17e8d0b073 /internal/db/bundb/admin.go
parent[feature] Enlarge active/hovered custom emojis in statuses (#877) (diff)
downloadgotosocial-56f53a2a6f85876485e2ae67d48b78b448caed6e.tar.xz
[performance] add user cache and database (#879)
* go fmt * add + use user cache and database * fix import * update tests * remove unused relation
Diffstat (limited to 'internal/db/bundb/admin.go')
-rw-r--r--internal/db/bundb/admin.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/db/bundb/admin.go b/internal/db/bundb/admin.go
index f66ed0294..9fa78eca0 100644
--- a/internal/db/bundb/admin.go
+++ b/internal/db/bundb/admin.go
@@ -30,6 +30,7 @@ import (
"time"
"github.com/superseriousbusiness/gotosocial/internal/ap"
+ "github.com/superseriousbusiness/gotosocial/internal/cache"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
@@ -40,7 +41,8 @@ import (
)
type adminDB struct {
- conn *DBConn
+ conn *DBConn
+ userCache *cache.UserCache
}
func (a *adminDB) IsUsernameAvailable(ctx context.Context, username string) (bool, db.Error) {
@@ -175,6 +177,7 @@ func (a *adminDB) NewSignup(ctx context.Context, username string, reason string,
Exec(ctx); err != nil {
return nil, a.conn.ProcessError(err)
}
+ a.userCache.Put(u)
return u, nil
}