Only keep valid oauth tokens alive

This commit is contained in:
Eli Ribble 2025-11-12 21:27:39 +00:00
parent bf3dedf7cd
commit 1fd407681e
No known key found for this signature in database

View file

@ -228,7 +228,7 @@ func refreshFieldseekerData(ctx context.Context, newOauthCh <-chan struct{}) {
workerCtx, cancel := context.WithCancel(context.Background())
var wg sync.WaitGroup
oauths, err := models.OauthTokens.Query().All(ctx, PGInstance.BobDB)
oauths, err := models.OauthTokens.Query(models.SelectWhere.OauthTokens.InvalidatedAt.IsNull()).All(ctx, PGInstance.BobDB)
if err != nil {
slog.Error("Failed to get oauths", slog.String("err", err.Error()))
return