[management] Fix race condition in experimental network map when deleting account (#5064)

This commit is contained in:
Bethuel Mmbaga
2026-01-08 14:10:09 +03:00
committed by GitHub
parent cf535f8c61
commit 00e2689ffb
2 changed files with 7 additions and 7 deletions

View File

@@ -32,13 +32,13 @@ func (h *Holder) AddAccount(account *Account) {
h.accounts[account.Id] = account
}
func (h *Holder) LoadOrStoreFunc(id string, accGetter func(context.Context, string) (*Account, error)) (*Account, error) {
func (h *Holder) LoadOrStoreFunc(ctx context.Context, id string, accGetter func(context.Context, string) (*Account, error)) (*Account, error) {
h.mu.Lock()
defer h.mu.Unlock()
if acc, ok := h.accounts[id]; ok {
return acc, nil
}
account, err := accGetter(context.Background(), id)
account, err := accGetter(ctx, id)
if err != nil {
return nil, err
}