mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-22 16:13:31 +01:00
Use update strength and simplify check
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
parent
6dd56e3328
commit
ec6438e643
@ -435,7 +435,7 @@ func (am *DefaultAccountManager) DeletePolicy(ctx context.Context, accountID, po
|
|||||||
var updateAccountPeers bool
|
var updateAccountPeers bool
|
||||||
|
|
||||||
err = am.Store.ExecuteInTransaction(ctx, func(transaction Store) error {
|
err = am.Store.ExecuteInTransaction(ctx, func(transaction Store) error {
|
||||||
policy, err = transaction.GetPolicyByID(ctx, LockingStrengthShare, accountID, policyID)
|
policy, err = transaction.GetPolicyByID(ctx, LockingStrengthUpdate, accountID, policyID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -502,8 +502,6 @@ func arePolicyChangesAffectPeers(ctx context.Context, transaction Store, account
|
|||||||
if hasPeers {
|
if hasPeers {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return anyGroupHasPeers(ctx, transaction, policy.AccountID, policy.ruleGroups())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return anyGroupHasPeers(ctx, transaction, policy.AccountID, policy.ruleGroups())
|
return anyGroupHasPeers(ctx, transaction, policy.AccountID, policy.ruleGroups())
|
||||||
|
Loading…
Reference in New Issue
Block a user