From 3d965a8b990367cee3f62128b2ff9c17b422bfc6 Mon Sep 17 00:00:00 2001 From: tobi Date: Wed, 26 Mar 2025 14:48:29 +0100 Subject: [PATCH] panic normally --- internal/db/bundb/account.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/db/bundb/account.go b/internal/db/bundb/account.go index c13291ca9..aacfcd247 100644 --- a/internal/db/bundb/account.go +++ b/internal/db/bundb/account.go @@ -878,7 +878,7 @@ func (a *accountDB) GetAccountFaves(ctx context.Context, accountID string) ([]*g return *faves, nil } -func qMediaOnly(ctx context.Context, q *bun.SelectQuery) *bun.SelectQuery { +func qMediaOnly(q *bun.SelectQuery) *bun.SelectQuery { // Attachments are stored as a json object; this // implementation differs between SQLite and Postgres, // so we have to be thorough to cover all eventualities @@ -896,8 +896,7 @@ func qMediaOnly(ctx context.Context, q *bun.SelectQuery) *bun.SelectQuery { Where("? != '[]'", bun.Ident("status.attachments")) default: - log.Panicf(ctx, "dialect %d was neither pg nor sqlite", d) - return q + panic("dialect " + d.String() + " was neither pg nor sqlite") } }) } @@ -944,7 +943,7 @@ func (a *accountDB) GetAccountStatuses(ctx context.Context, accountID string, li // Respect media-only preference. if mediaOnly { - q = qMediaOnly(ctx, q) + q = qMediaOnly(q) } if publicOnly { @@ -1086,7 +1085,7 @@ func (a *accountDB) GetAccountWebStatuses( // Respect media-only preference. if mediaOnly { - q = qMediaOnly(ctx, q) + q = qMediaOnly(q) } // Return only statuses LOWER (ie., older) than maxID