Skip to content

Commit

Permalink
add cache to github:user data api (#10148)
Browse files Browse the repository at this point in the history
* add cache to github:user data api

* fix indentation
  • Loading branch information
jwunderl authored and abchatra committed Sep 4, 2024
1 parent 083ce54 commit 9f6f789
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webapp/src/cloudsync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -516,7 +516,7 @@ function pingApiHandlerAsync(p: string): Promise<any> {
}

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,
Expand Down

0 comments on commit 9f6f789

Please sign in to comment.