From 9f6f7895df02691e595f15c5f9af12870396dcac Mon Sep 17 00:00:00 2001 From: Joey Wunderlich Date: Tue, 3 Sep 2024 14:30:09 -0700 Subject: [PATCH] add cache to github:user data api (#10148) * add cache to github:user data api * fix indentation --- webapp/src/cloudsync.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webapp/src/cloudsync.ts b/webapp/src/cloudsync.ts index b0256634a6ff..443161658d4d 100644 --- a/webapp/src/cloudsync.ts +++ b/webapp/src/cloudsync.ts @@ -122,8 +122,8 @@ export class ProviderBase { pxt.storage.setLocal(this.name + CLOUD_USER, JSON.stringify(user)) else pxt.storage.removeLocal(this.name + CLOUD_USER); - data.invalidate("sync:user") - data.invalidate("github:user") + data.invalidate("sync:user") + data.invalidate("github:user") } protected token() { @@ -516,7 +516,7 @@ function pingApiHandlerAsync(p: string): Promise { } data.mountVirtualApi("sync", { getSync: syncApiHandler }) -data.mountVirtualApi("github", { getSync: githubApiHandler }) +data.mountVirtualApi("github", { getSync: githubApiHandler, expirationTime: p => 24 * 3600 * 1000 }) data.mountVirtualApi("ping", { getAsync: pingApiHandlerAsync, expirationTime: p => 24 * 3600 * 1000,