add extra logging

This commit is contained in:
Harvey Tindall
2021-04-06 18:02:15 +01:00
parent 78049d4a33
commit e6e5231f63
3 changed files with 16 additions and 13 deletions
+4 -2
View File
@@ -2,6 +2,7 @@ package main
import (
"encoding/json"
"fmt"
"io/fs"
"log"
"os"
@@ -480,11 +481,11 @@ func (st *Storage) storeInvites() error {
}
func (st *Storage) loadUsers() error {
st.usersLock.Lock()
defer st.usersLock.Unlock()
if st.users == nil {
st.users = map[string]time.Time{}
}
st.usersLock.Lock()
defer st.usersLock.Unlock()
temp := map[string]time.Time{}
err := loadJSON(st.users_path, &temp)
if err != nil {
@@ -495,6 +496,7 @@ func (st *Storage) loadUsers() error {
st.users[id] = t1
}
}
fmt.Printf("CURRENT USERS:\n%+v\n", st.users)
return nil
}