From e1d2f9ff3eb1b617ef1cfdd73b0f73bb4f271f72 Mon Sep 17 00:00:00 2001 From: "Mr. Stallion" Date: Mon, 29 Jun 2020 11:34:56 -0500 Subject: [PATCH] Fix cache miss on metadata --- learn/profile-cache.ts | 4 ++-- site/character_page/character_page.vue | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/learn/profile-cache.ts b/learn/profile-cache.ts index 70d7170..9ee3acf 100644 --- a/learn/profile-cache.ts +++ b/learn/profile-cache.ts @@ -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 { 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, diff --git a/site/character_page/character_page.vue b/site/character_page/character_page.vue index ed3c835..311cf44 100644 --- a/site/character_page/character_page.vue +++ b/site/character_page/character_page.vue @@ -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;