mirror of
https://github.com/hassio-addons/bashio.git
synced 2025-05-06 20:11:24 +00:00
Avoid caching when API call fails (#164)
This commit is contained in:
parent
d70505aada
commit
445707a903
15 changed files with 104 additions and 0 deletions
|
@ -28,6 +28,10 @@ function bashio::services() {
|
|||
config=$(bashio::cache.get "${cache_key}")
|
||||
else
|
||||
config=$(bashio::api.supervisor GET "/services/${service}" false)
|
||||
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
|
||||
bashio::log.error "Failed to get services from Supervisor API"
|
||||
return "${__BASHIO_EXIT_NOK}"
|
||||
fi
|
||||
bashio::cache.set "${cache_key}" "${config}"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue