feat(protocol/brokeprotocol): replace explicit got usage (#689)

* feat(protocols/brokeprotocol): replace explicit got usage

* dont overcomplicate things, it should always be ok

* docs: fix return type for checkApi

* feat: restore limit 0
This commit is contained in:
CosminPerRam 2025-04-26 15:06:49 +03:00 committed by GitHub
parent f760f0c726
commit 6821e664b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,5 +1,4 @@
import Core from './core.js'
import got from 'got'
// import Ajv from 'ajv'
// const ajv = new Ajv()
@ -123,16 +122,17 @@ export default class brokeprotocolmaster extends Core {
/**
* Checks if the API is available
* @returns a list of servers as raw data
* @returns a boolean representing api availability
*/
async checkApi () {
try {
const response = await got(this.backendApiUriCheck, {
await this.request({
url: this.backendApiUriCheck,
method: 'HEAD',
timeout: { request: 2000 },
retry: { limit: 0 }
retry: { limit: 0 } // TODO: #650 remove this
})
return !!response?.ok
return true
} catch (err) {
// ignore error message
}