From a3c6f1e98b1b51fe68da5bb2db9d5598722532ed Mon Sep 17 00:00:00 2001 From: Tuan Pham Anh Date: Mon, 17 Jun 2024 09:34:40 +0700 Subject: [PATCH] relay: update cron_update_client.sh --- relay/cron/cron_update_client.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/relay/cron/cron_update_client.sh b/relay/cron/cron_update_client.sh index b416ec72..a45e78d8 100644 --- a/relay/cron/cron_update_client.sh +++ b/relay/cron/cron_update_client.sh @@ -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) @@ -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