MCPcopy Create free account
hub / github.com/electron/update.electronjs.org / cachedGetLatest

Method cachedGetLatest

index.js:68–84  ·  view source on GitHub ↗
(account, repository, platform)

Source from the content-addressed store, hash-verified

66 }
67
68 async cachedGetLatest (account, repository, platform) {
69 const key = `${account}/${repository}/${platform}`
70 let latest = await this.cache.get(key)
71 if (latest) {
72 this.log(`cache hit ${key}`)
73 return latest.version ? latest : null
74 }
75
76 latest = await this.getLatest(account, repository, platform)
77 if (latest) {
78 await this.cache.set(key, latest)
79 return latest
80 } else {
81 await this.cache.set(key, {})
82 return null
83 }
84 }
85
86 async getLatest (account, repository, platform) {
87 const url = `https://api.github.com/repos/${account}/${repository}/releases?per_page=100`

Callers 2

handleReleasesMethod · 0.95
handleUpdateMethod · 0.95

Calls 4

logMethod · 0.95
getLatestMethod · 0.95
getMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected