mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-23 23:53:32 -06:00
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:
parent
64bd689e55
commit
9dc2255a8f
20 changed files with 537 additions and 163 deletions
|
|
@ -147,6 +147,11 @@ func NewBunDBService(ctx context.Context, c *config.Config, log *logrus.Logger)
|
|||
return nil, fmt.Errorf("database type %s not supported for bundb", strings.ToLower(c.DBConfig.Type))
|
||||
}
|
||||
|
||||
if log.Level >= logrus.TraceLevel {
|
||||
// add a hook to just log queries and the time they take
|
||||
conn.DB.AddQueryHook(newDebugQueryHook(log))
|
||||
}
|
||||
|
||||
// actually *begin* the connection so that we can tell if the db is there and listening
|
||||
if err := conn.Ping(); err != nil {
|
||||
return nil, fmt.Errorf("db connection error: %s", err)
|
||||
|
|
@ -402,7 +407,7 @@ func (ps *bunDBService) MentionStringsToMentions(ctx context.Context, targetAcco
|
|||
return menchies, nil
|
||||
}
|
||||
|
||||
func (ps *bunDBService) TagStringsToTags(ctx context.Context, tags []string, originAccountID string, statusID string) ([]*gtsmodel.Tag, error) {
|
||||
func (ps *bunDBService) TagStringsToTags(ctx context.Context, tags []string, originAccountID string) ([]*gtsmodel.Tag, error) {
|
||||
newTags := []*gtsmodel.Tag{}
|
||||
for _, t := range tags {
|
||||
tag := >smodel.Tag{}
|
||||
|
|
@ -438,7 +443,7 @@ func (ps *bunDBService) TagStringsToTags(ctx context.Context, tags []string, ori
|
|||
return newTags, nil
|
||||
}
|
||||
|
||||
func (ps *bunDBService) EmojiStringsToEmojis(ctx context.Context, emojis []string, originAccountID string, statusID string) ([]*gtsmodel.Emoji, error) {
|
||||
func (ps *bunDBService) EmojiStringsToEmojis(ctx context.Context, emojis []string) ([]*gtsmodel.Emoji, error) {
|
||||
newEmojis := []*gtsmodel.Emoji{}
|
||||
for _, e := range emojis {
|
||||
emoji := >smodel.Emoji{}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue