Merge branch 'posturechecks-get-account-refactoring' into policy-get-account-refactoring

This commit is contained in:
bcmmbaga 2024-11-12 23:53:46 +03:00
commit 9bc8e6e29e
No known key found for this signature in database
GPG Key ID: 511EED5C928AD547

View File

@ -609,12 +609,12 @@ func (am *DefaultAccountManager) anyGroupHasPeers(account *Account, groupIDs []s
// anyGroupHasPeers checks if any of the given groups in the account have peers.
func anyGroupHasPeers(ctx context.Context, transaction Store, accountID string, groupIDs []string) (bool, error) {
for _, groupID := range groupIDs {
group, err := transaction.GetGroupByID(ctx, LockingStrengthShare, accountID, groupID)
groups, err := transaction.GetGroupsByIDs(ctx, LockingStrengthShare, accountID, groupIDs)
if err != nil {
return false, err
}
for _, group := range groups {
if group.HasPeers() {
return true, nil
}