mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-29 03:23:56 +01:00
Merge branch 'posturechecks-get-account-refactoring' into policy-get-account-refactoring
This commit is contained in:
commit
9bc8e6e29e
@ -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.
|
// 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) {
|
func anyGroupHasPeers(ctx context.Context, transaction Store, accountID string, groupIDs []string) (bool, error) {
|
||||||
for _, groupID := range groupIDs {
|
groups, err := transaction.GetGroupsByIDs(ctx, LockingStrengthShare, accountID, groupIDs)
|
||||||
group, err := transaction.GetGroupByID(ctx, LockingStrengthShare, accountID, groupID)
|
if err != nil {
|
||||||
if err != nil {
|
return false, err
|
||||||
return false, err
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
for _, group := range groups {
|
||||||
if group.HasPeers() {
|
if group.HasPeers() {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user