kim is a reply guy (#208)

* bun debug

* bun trace logging hooks

* more tests

* fix up some stuffffff

* drop the frontend cache until a proper fix is made

* go fmt
This commit is contained in:
tobi 2021-09-11 13:19:06 +02:00 committed by GitHub
commit 9dc2255a8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 537 additions and 163 deletions

View file

@ -22,7 +22,6 @@ import (
"context"
"errors"
"fmt"
"strings"
"time"
"github.com/superseriousbusiness/gotosocial/internal/cache"
@ -103,16 +102,15 @@ func (a *accountDB) getAccount(ctx context.Context, cacheGet func() (*gtsmodel.A
}
func (a *accountDB) UpdateAccount(ctx context.Context, account *gtsmodel.Account) (*gtsmodel.Account, db.Error) {
if strings.TrimSpace(account.ID) == "" {
// TODO: we should not need this check here
return nil, errors.New("account had no ID")
}
// Update the account's last-used
// Update the account's last-updated
account.UpdatedAt = time.Now()
// Update the account model in the DB
_, err := a.conn.NewUpdate().Model(account).WherePK().Exec(ctx)
_, err := a.conn.
NewUpdate().
Model(account).
WherePK().
Exec(ctx)
if err != nil {
return nil, a.conn.ProcessError(err)
}