diff --git a/api-invites.go b/api-invites.go index e3d6cd0..4d94a0d 100644 --- a/api-invites.go +++ b/api-invites.go @@ -15,7 +15,6 @@ import ( func (app *appContext) checkInvites() { currentTime := time.Now() - app.storage.loadInvites() for _, data := range app.storage.GetInvites() { expiry := data.ValidTill if !currentTime.After(expiry) { @@ -59,7 +58,6 @@ func (app *appContext) checkInvites() { func (app *appContext) checkInvite(code string, used bool, username string) bool { currentTime := time.Now() - app.storage.loadInvites() inv, match := app.storage.GetInvitesKey(code) if !match { return false @@ -128,7 +126,6 @@ func (app *appContext) checkInvite(code string, used bool, username string) bool func (app *appContext) GenerateInvite(gc *gin.Context) { var req generateInviteDTO app.debug.Println("Generating new invite") - app.storage.loadInvites() gc.BindJSON(&req) currentTime := time.Now() validTill := currentTime.AddDate(0, req.Months, req.Days) @@ -222,7 +219,6 @@ func (app *appContext) GenerateInvite(gc *gin.Context) { func (app *appContext) GetInvites(gc *gin.Context) { app.debug.Println("Invites requested") currentTime := time.Now() - app.storage.loadInvites() app.checkInvites() var invites []inviteDTO for _, inv := range app.storage.GetInvites() { @@ -344,8 +340,6 @@ func (app *appContext) SetNotify(gc *gin.Context) { changed := false for code, settings := range req { app.debug.Printf("%s: Notification settings change requested", code) - app.storage.loadInvites() - app.storage.loadEmails() invite, ok := app.storage.GetInvitesKey(code) if !ok { app.err.Printf("%s Notification setting change failed: Invalid code", code) diff --git a/api-userpage.go b/api-userpage.go index 780a4ee..a517ee8 100644 --- a/api-userpage.go +++ b/api-userpage.go @@ -42,11 +42,6 @@ func (app *appContext) MyDetails(gc *gin.Context) { resp.Expiry = exp.Expiry.Unix() } - app.storage.loadEmails() - app.storage.loadDiscordUsers() - app.storage.loadMatrixUsers() - app.storage.loadTelegramUsers() - if emailEnabled { resp.Email = &MyDetailsContactMethodsDTO{} if email, ok := app.storage.GetEmailsKey(user.ID); ok && email.Addr != "" { diff --git a/daemon.go b/daemon.go index 8248c53..320afac 100644 --- a/daemon.go +++ b/daemon.go @@ -116,7 +116,6 @@ func (rt *housekeepingDaemon) run() { break } started := time.Now() - rt.app.storage.loadInvites() for _, job := range rt.jobs { job(rt.app) diff --git a/pwreset.go b/pwreset.go index be3d3fb..ae387d1 100644 --- a/pwreset.go +++ b/pwreset.go @@ -100,7 +100,6 @@ func pwrMonitor(app *appContext, watcher *fsnotify.Watcher) { app.debug.Printf("Error: %s", err) return } - app.storage.loadEmails() uid := user.ID if uid == "" { app.err.Printf("Couldn't get user ID for user \"%s\"", pwr.Username)