Fix peer login expiration event duplication (#1185)

This commit is contained in:
Misha Bragin 2023-09-29 17:37:04 +02:00 committed by GitHub
parent c81b83b346
commit 6ad3894a51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -836,6 +836,9 @@ func (am *DefaultAccountManager) GetUsersFromAccount(accountID, userID string) (
func (am *DefaultAccountManager) expireAndUpdatePeers(account *Account, peers []*Peer) error {
var peerIDs []string
for _, peer := range peers {
if peer.Status.LoginExpired {
continue
}
peerIDs = append(peerIDs, peer.ID)
peer.MarkLoginExpired(true)
account.UpdatePeer(peer)