Fix cache miss on metadata
This commit is contained in:
parent
b08e3b36f0
commit
e1d2f9ff3e
|
@ -13,7 +13,7 @@ export interface MetaRecord {
|
|||
groups: CharacterGroup[] | null;
|
||||
friends: SimpleCharacter[] | null;
|
||||
guestbook: Guestbook | null;
|
||||
lastFetched: Date | null;
|
||||
lastMetaFetched: Date | null;
|
||||
}
|
||||
|
||||
|
||||
|
@ -83,7 +83,7 @@ export class ProfileCache extends AsyncCache<CharacterCacheRecord> {
|
|||
cacheRecord.added = new Date(pd.firstSeen * 1000);
|
||||
|
||||
cacheRecord.meta = {
|
||||
lastFetched: pd.lastMetaFetched ? new Date(pd.lastMetaFetched) : null,
|
||||
lastMetaFetched: pd.lastMetaFetched ? new Date(pd.lastMetaFetched) : null,
|
||||
groups: pd.groups,
|
||||
friends: pd.friends,
|
||||
images: pd.images,
|
||||
|
|
|
@ -303,7 +303,7 @@
|
|||
await core.cache.profileCache.registerMeta(
|
||||
name,
|
||||
{
|
||||
lastFetched: new Date(),
|
||||
lastMetaFetched: new Date(),
|
||||
groups: this.groups,
|
||||
friends: this.friends,
|
||||
guestbook: this.guestbook,
|
||||
|
@ -365,8 +365,8 @@
|
|||
if (
|
||||
(cache && !skipCache)
|
||||
&& (cache.meta)
|
||||
&& (cache.meta.lastFetched)
|
||||
&& (Date.now() - cache.meta.lastFetched.getTime() > CHARACTER_META_CACHE_EXPIRE)
|
||||
&& (cache.meta.lastMetaFetched)
|
||||
&& (Date.now() - cache.meta.lastMetaFetched.getTime() > CHARACTER_META_CACHE_EXPIRE)
|
||||
) {
|
||||
this.guestbook = cache.meta.guestbook;
|
||||
this.friends = cache.meta.friends;
|
||||
|
|
Loading…
Reference in New Issue