Skip to content
This repository has been archived by the owner on Aug 12, 2021. It is now read-only.

Commit

Permalink
feat: Bump schema version number. Restore use of "lastProgramUpdateTime"
Browse files Browse the repository at this point in the history
  • Loading branch information
EdNutting committed Nov 11, 2020
1 parent 02eba08 commit 2f1cc83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/classes/DataLayer/Cache/Cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export default class Cache {

private logger: DebugLogger = new DebugLogger("Cache");
private readonly cacheStaleTime = 1000 * 60 * 60 * 24; // 24 hours
private readonly cacheInactiveTime = 1000 * 60 * 60; // 60 minutes
private readonly cacheInactiveTime = 1000 * 60 * 10; // 10 minutes
private readonly liveQueryTrustedTime = 1000 * 60 * 1; // 1 minutes

private static parseLive: Parse.LiveQueryClient | null = null;
Expand Down Expand Up @@ -450,7 +450,8 @@ export default class Cache {
this.fillingEntireCachePromise = new Promise(async (resolve, reject) => {
try {
let localRefillTime = localRefillTimes["ENTIRE_CACHE"] ?? new Date(0);
if (localRefillTime.getTime() + this.cacheInactiveTime < now) {
if (localRefillTime.getTime() + this.cacheInactiveTime < now
|| remoteLastProgramUpdateTime.getTime() > now) {
const {
Conference,

Expand Down
2 changes: 1 addition & 1 deletion src/classes/DataLayer/CachedSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type Indexes<T> = { [K in PromisedKeys<T>]: "id" };
// be increased.

// Decimal places are not allowed - only positive integers!
export const SchemaVersion: number = 10;
export const SchemaVersion: number = 11;

export interface CachableDBSchema extends IDB.DBSchema {
[s: string]: DBSchemaValue;
Expand Down

0 comments on commit 2f1cc83

Please sign in to comment.