Use update strength and simplify check

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
bcmmbaga 2024-11-18 17:12:13 +03:00
parent 6dd56e3328
commit ec6438e643
No known key found for this signature in database
GPG Key ID: 511EED5C928AD547

View File

@ -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())