firewalldb: thread context to PrivMap NewPair

Update the NewPair method of the PrivacyMapTx interface to take a
context.
This commit is contained in:
Elle Mouton 2025-03-13 16:22:39 -05:00
parent 7ce36d7e7d
commit 197ee3b5ba
No known key found for this signature in database
GPG key ID: D7D916376026F177
5 changed files with 67 additions and 55 deletions

View file

@ -1226,11 +1226,11 @@ func (s *sessionRpcServer) AddAutopilotSession(ctx context.Context,
// Register all the privacy map pairs for this session ID.
privDB := s.cfg.privMap(sess.GroupID)
err = privDB.Update(ctx, func(_ context.Context,
err = privDB.Update(ctx, func(ctx context.Context,
tx firewalldb.PrivacyMapTx) error {
for r, p := range newPrivMapPairs {
err := tx.NewPair(r, p)
err := tx.NewPair(ctx, r, p)
if err != nil {
return err
}