Refactor update account peers

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
bcmmbaga
2024-10-31 22:30:13 +03:00
parent 8cacdae70c
commit e73b5da42b
10 changed files with 49 additions and 168 deletions

View File

@@ -79,12 +79,7 @@ func (am *DefaultAccountManager) SavePostureChecks(ctx context.Context, accountI
am.StoreEvent(ctx, userID, postureChecks.ID, accountID, action, postureChecks.EventMeta())
if updateAccountPeers {
account, err := am.requestBuffer.GetAccountWithBackpressure(ctx, accountID)
if err != nil {
return fmt.Errorf("failed to get account: %w", err)
}
am.updateAccountPeers(ctx, account)
am.updateAccountPeers(ctx, accountID)
}
return nil