mirror of
https://github.com/hassio-addons/bashio.git
synced 2025-05-06 20:11:24 +00:00
Fix caching API response caching bug (#48)
This commit is contained in:
parent
abd81ec1c9
commit
71aeb066fb
3 changed files with 6 additions and 6 deletions
|
@ -96,7 +96,7 @@ function bashio::core() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if bashio::cache.exists 'core.info'; then
|
if bashio::cache.exists 'core.info'; then
|
||||||
info=$(bashio::cache.get 'supervisor.core')
|
info=$(bashio::cache.get 'core.info')
|
||||||
else
|
else
|
||||||
info=$(bashio::api.supervisor GET /core/info false)
|
info=$(bashio::api.supervisor GET /core/info false)
|
||||||
bashio::cache.set 'core.info' "${info}"
|
bashio::cache.set 'core.info' "${info}"
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
# $2 jq Filter to apply on the result (optional)
|
# $2 jq Filter to apply on the result (optional)
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
function bashio::info() {
|
function bashio::info() {
|
||||||
local cache_key=${1:-'supervisor.info'}
|
local cache_key=${1:-'info'}
|
||||||
local filter=${2:-}
|
local filter=${2:-}
|
||||||
local info
|
local info
|
||||||
local response
|
local response
|
||||||
|
@ -27,11 +27,11 @@ function bashio::info() {
|
||||||
return "${__BASHIO_EXIT_OK}"
|
return "${__BASHIO_EXIT_OK}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if bashio::cache.exists 'supervisor.info'; then
|
if bashio::cache.exists 'info'; then
|
||||||
info=$(bashio::cache.get 'supervisor.info')
|
info=$(bashio::cache.get 'info')
|
||||||
else
|
else
|
||||||
info=$(bashio::api.supervisor GET /info false)
|
info=$(bashio::api.supervisor GET /info false)
|
||||||
bashio::cache.set 'supervisor.info' "${info}"
|
bashio::cache.set 'info' "${info}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
response="${info}"
|
response="${info}"
|
||||||
|
|
|
@ -56,7 +56,7 @@ function bashio::os() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if bashio::cache.exists 'os.info'; then
|
if bashio::cache.exists 'os.info'; then
|
||||||
info=$(bashio::cache.get 'supervisor.os')
|
info=$(bashio::cache.get 'os.info')
|
||||||
else
|
else
|
||||||
info=$(bashio::api.supervisor GET /os/info false)
|
info=$(bashio::api.supervisor GET /os/info false)
|
||||||
bashio::cache.set 'os.info' "${info}"
|
bashio::cache.set 'os.info' "${info}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue