Skip to content

Commit

Permalink
Finish applying code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed May 14, 2024
1 parent cdbfd80 commit a57c111
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/serviceworker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ self.addEventListener("fetch", (event: FetchEvent) => {

async function tryUpdateServerSupportMap(clientApiUrl: string, accessToken?: string): Promise<void> {
// only update if we don't know about it, or if the data is stale
if (serverSupportMap[clientApiUrl]?.cacheExpires > new Date().getTime()) {
if (serverSupportMap[clientApiUrl]?.cacheExpiryTimeMs > new Date().getTime()) {
return; // up to date
}

Expand All @@ -107,7 +107,7 @@ async function tryUpdateServerSupportMap(clientApiUrl: string, accessToken?: str

serverSupportMap[clientApiUrl] = {
supportsMSC3916: Boolean(versions?.unstable_features?.["org.matrix.msc3916"]),
cacheExpires: new Date().getTime() + 2 * 60 * 60 * 1000, // 2 hours from now
cacheExpiryTimeMs: new Date().getTime() + 2 * 60 * 60 * 1000, // 2 hours from now
};
}

Expand Down

0 comments on commit a57c111

Please sign in to comment.