session: remove Session Group Predicate method

This was used to check that all linked sessions are no longer
active before attempting to register an autopilot session. But this is
no longer needed since this is done within NewSession.
This commit is contained in:
Elle Mouton 2025-02-09 13:47:19 +02:00
parent 013e7c081c
commit 32a34d1245
No known key found for this signature in database
GPG key ID: D7D916376026F177
4 changed files with 1 additions and 177 deletions

View file

@ -874,23 +874,6 @@ func (s *sessionRpcServer) AddAutopilotSession(ctx context.Context,
"group %x", groupSess.ID, groupSess.GroupID)
}
// Now we need to check that all the sessions in the group are
// no longer active.
ok, err := s.cfg.db.CheckSessionGroupPredicate(
groupID, func(s *session.Session) bool {
return s.State == session.StateRevoked ||
s.State == session.StateExpired
},
)
if err != nil {
return nil, err
}
if !ok {
return nil, fmt.Errorf("a linked session in group "+
"%x is still active", groupID)
}
linkedGroupID = &groupID
linkedGroupSession = groupSess