Stop calling an endpoint that will never come. (#583)

This commit is contained in:
Justin Bassett 2020-05-08 10:09:34 -04:00 committed by GitHub
parent 40e16c370c
commit 885911814e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -265,25 +265,9 @@ class IntegrationRepositoryImpl @Inject constructor(
throw IntegrationException() throw IntegrationException()
} }
// TODO: Use websocket to get panels.
override suspend fun getPanels(): Array<Panel> { override suspend fun getPanels(): Array<Panel> {
val getPanelsRequest = return arrayOf()
IntegrationRequest(
"get_panels",
null
)
var response: Array<Panel>? = null
for (it in urlRepository.getApiUrls()) {
try {
response = integrationService.getPanels(it.toHttpUrlOrNull()!!, getPanelsRequest)
} catch (e: Exception) {
// Ignore failure until we are out of URLS to try!
}
if (response !== null)
return response
}
throw IntegrationException()
} }
override suspend fun getServices(): Array<Service> { override suspend fun getServices(): Array<Service> {