Skip to content

Commit

Permalink
relay: update cron_update_client.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
baabeetaa committed Jun 17, 2024
1 parent f44900b commit a3c6f1e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions relay/cron/cron_update_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ DEFAULT_THRESHOLD_TIME=43200
URL="https://status.notional.ventures/ibc_monitor/get_last_ibc_client_update?hermes_config_url=https%3A%2F%2Fraw.githubusercontent.com%2Fnotional-labs%2Fcosmosia%2Fmain%2Frelay%2F${hubname}_config.toml"
items=$(curl -s "$URL" |jq -c -r '.[]')

TESTNETS="(testnet|narwhal-2|osmo-test-5|theta-testnet-001)"

echo "$items" | while IFS= read -r item ; do
chain_id=$(echo "$item" |jq -r .chain_id)
client_id=$(echo $item |jq -r .client_id)
Expand All @@ -45,8 +47,8 @@ echo "$items" | while IFS= read -r item ; do
threshold_time=3600
fi

# 1 hour for testnet
if [ $( echo "${chain_id}" | grep -cE "(testnet)" ) -ne 0 ] || [ $( echo "${counter_chain_id}" | grep -cE "(testnet)" ) -ne 0 ] ; then
# 1 hour for testnet, but we dont know if its a testnet based on chain-id, so have to make a list
if [ $( echo "${chain_id}" | grep -cE $TESTNETS ) -ne 0 ] || [ $( echo "${counter_chain_id}" | grep -cE $TESTNETS ) -ne 0 ] ; then
threshold_time=3600
fi

Expand Down

0 comments on commit a3c6f1e

Please sign in to comment.