(account, repository, platform)
| 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` |
no test coverage detected