* Query for and return the latest update.
(force?: boolean)
| 39 | * Query for and return the latest update. |
| 40 | */ |
| 41 | public async getUpdate(force?: boolean): Promise<Update> { |
| 42 | // Don't run multiple requests at a time. |
| 43 | if (!this.update) { |
| 44 | this.update = this._getUpdate(force) |
| 45 | this.update.then(() => (this.update = undefined)) |
| 46 | } |
| 47 | |
| 48 | return this.update |
| 49 | } |
| 50 | |
| 51 | private async _getUpdate(force?: boolean): Promise<Update> { |
| 52 | const now = Date.now() |
no test coverage detected