accounts: invalidate web user cache on changes as well
previously used app.jf.CacheExpiry = time.Now(), now either call app.InvalidateJellyfinCache() (when we only need it to get a user), or app.InvalidateUserCaches() (when the web user list needs to be updated).
This commit is contained in:
+13
-2
@@ -10,13 +10,24 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// FIXME: Invalidate cache on delete/modify/etc.
|
||||
|
||||
const (
|
||||
USER_DEFAULT_SORT_FIELD = "name"
|
||||
USER_DEFAULT_SORT_ASCENDING = true
|
||||
)
|
||||
|
||||
func (app *appContext) InvalidateUserCaches() {
|
||||
app.InvalidateJellyfinCache()
|
||||
app.InvalidateWebUserCache()
|
||||
}
|
||||
|
||||
func (app *appContext) InvalidateJellyfinCache() {
|
||||
app.jf.CacheExpiry = time.Now()
|
||||
}
|
||||
|
||||
func (app *appContext) InvalidateWebUserCache() {
|
||||
app.userCache.LastSync = time.Time{}
|
||||
}
|
||||
|
||||
// UserCache caches the transport representation of users,
|
||||
// complementing the built-in cache of the mediabrowser package.
|
||||
// Synchronisation runs in the background and consumers receive
|
||||
|
||||
Reference in New Issue
Block a user