mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-15 14:56:42 +00:00
Other: Add some more debug logs
This commit is contained in:
@ -31,6 +31,7 @@ import (
|
||||
|
||||
"github.com/ProtonMail/proton-bridge/v2/internal/certs"
|
||||
"github.com/bradenaw/juniper/xslices"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/vmihailenco/msgpack/v5"
|
||||
)
|
||||
|
||||
@ -184,6 +185,8 @@ func (vault *Vault) attachUser(userID string) *User {
|
||||
vault.refLock.Lock()
|
||||
defer vault.refLock.Unlock()
|
||||
|
||||
logrus.WithField("userID", userID).Trace("Attaching vault user")
|
||||
|
||||
vault.ref[userID]++
|
||||
|
||||
return &User{
|
||||
@ -196,6 +199,8 @@ func (vault *Vault) detachUser(userID string) error {
|
||||
vault.refLock.Lock()
|
||||
defer vault.refLock.Unlock()
|
||||
|
||||
logrus.WithField("userID", userID).Trace("Detaching vault user")
|
||||
|
||||
if _, ok := vault.ref[userID]; !ok {
|
||||
return fmt.Errorf("user %s is not attached", userID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user