[management] exclude peers for expiration job that have already been marked expired (#5970)

This commit is contained in:
Pascal Fischer
2026-04-23 16:01:54 +02:00
committed by GitHub
parent b6038e8acd
commit fa0d58d093
6 changed files with 62 additions and 12 deletions

View File

@@ -3310,7 +3310,7 @@ func (s *SqlStore) GetAccountPeersWithExpiration(ctx context.Context, lockStreng
var peers []*nbpeer.Peer
result := tx.
Where("login_expiration_enabled = ? AND user_id IS NOT NULL AND user_id != ''", true).
Where("login_expiration_enabled = ? AND peer_status_login_expired != ? AND user_id IS NOT NULL AND user_id != ''", true, true).
Find(&peers, accountIDCondition, accountID)
if err := result.Error; err != nil {
log.WithContext(ctx).Errorf("failed to get peers with expiration from the store: %s", result.Error)