mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
session: remove variadic State param from ListSessionsByState
We only really ever use it in one place and even then, only for a session State that we no longer use anymore. This is done to make the SQL queries we will need to implement the SQL Store more simple.
This commit is contained in:
parent
66b0f15176
commit
306519fd6d
4 changed files with 17 additions and 24 deletions
|
|
@ -102,13 +102,23 @@ func (s *sessionRpcServer) start(ctx context.Context) error {
|
|||
}
|
||||
|
||||
// Start up all previously created sessions.
|
||||
sessions, err := s.cfg.db.ListSessionsByState(
|
||||
ctx, session.StateCreated, session.StateInUse,
|
||||
sessions, err := s.cfg.db.ListSessionsByState(ctx, session.StateCreated)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error listing sessions: %v", err)
|
||||
}
|
||||
|
||||
// For backwards compatibility, we will also resume sessions that are in
|
||||
// the InUse state even though we no longer put sessions into this
|
||||
// state.
|
||||
inUseSessions, err := s.cfg.db.ListSessionsByState(
|
||||
ctx, session.StateInUse,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error listing sessions: %v", err)
|
||||
}
|
||||
|
||||
sessions = append(sessions, inUseSessions...)
|
||||
|
||||
for _, sess := range sessions {
|
||||
key := sess.LocalPublicKey.SerializeCompressed()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue