add more error logging; mutex for app.storage.users

This commit is contained in:
Harvey Tindall
2021-04-06 13:44:52 +01:00
parent ab3d5f3321
commit 76b822213e
4 changed files with 31 additions and 7 deletions
+3 -1
View File
@@ -26,7 +26,7 @@ type Storage struct {
policy mediabrowser.Policy
configuration mediabrowser.Configuration
lang Lang
invitesLock sync.Mutex
invitesLock, usersLock sync.Mutex
}
type customEmails struct {
@@ -480,6 +480,8 @@ func (st *Storage) storeInvites() error {
}
func (st *Storage) loadUsers() error {
st.usersLock.Lock()
defer st.usersLock.Unlock()
return loadJSON(st.users_path, &st.users)
}