From 5c81299ef185f9fdfb19b58eaa614115a258832a Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 7 Dec 2023 15:09:54 +0100 Subject: [PATCH] Activate better cache refreshing --- 20h12.process.sh | 6 +++--- RUNTIME/NODE.refresh.sh | 11 +++++++++++ _12345.sh | 4 +++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/20h12.process.sh b/20h12.process.sh index c458aa45..3e326a2c 100755 --- a/20h12.process.sh +++ b/20h12.process.sh @@ -48,12 +48,12 @@ espeak "Players refresh" > /dev/null 2>&1 # Refresh ~/.zen/game/players/PLAYER ~/.zen/Astroport.ONE/RUNTIME/PLAYER.refresh.sh -espeak "REFRESHING NODE" > /dev/null 2>&1 -~/.zen/Astroport.ONE/RUNTIME/NODE.refresh.sh - espeak "REFRESHING UPLANET" > /dev/null 2>&1 ~/.zen/Astroport.ONE/RUNTIME/UPLANET.refresh.sh +espeak "REFRESHING NODE" > /dev/null 2>&1 +~/.zen/Astroport.ONE/RUNTIME/NODE.refresh.sh + ## if [[ ! $isLAN ]]; then ## REFRESH BOOSTRAP LIST (OFFICIAL SWARM) diff --git a/RUNTIME/NODE.refresh.sh b/RUNTIME/NODE.refresh.sh index ac16d480..d927398d 100755 --- a/RUNTIME/NODE.refresh.sh +++ b/RUNTIME/NODE.refresh.sh @@ -15,6 +15,8 @@ MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized echo "## RUNNING NODE.refresh" [[ ${IPFSNODEID} == "" ]] && echo "IPFSNODEID is empty - EXIT -" && exit 1 + MOATS=$(date -u +"%Y%m%d%H%M%S%4N") + ################################################################# ## IPFSNODEID ASTRONAUTES SIGNALING ## 12345 port ############################ @@ -31,9 +33,13 @@ if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then cp $HOME/.zen/.yt-dlp.list ~/.zen/tmp/${IPFSNODEID}/yt-dlp.list ## COPY COINS VALUE OF THE DAY + rm -Rf ~/.zen/tmp/${IPFSNODEID}/COINS/ mkdir -p ~/.zen/tmp/${IPFSNODEID}/COINS/ cp -f ~/.zen/tmp/coucou/*.COINS ~/.zen/tmp/${IPFSNODEID}/COINS/ + ## COPY 20h12.log + cp -f /tmp/20h12.log ~/.zen/tmp/${IPFSNODEID}/ + ## COPY FRIENDS PLAYERONE=($(ls -t ~/.zen/game/players/ | grep "@" 2>/dev/null)) echo "FOUND : ${PLAYERONE[@]}" @@ -46,6 +52,11 @@ if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then done cp ~/.zen/GPS ~/.zen/tmp/${IPFSNODEID}/ + + ## REFRESH TIMESTAMPING + echo "${MOATS}" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.moats + echo "$(date -u)" > ~/.zen/tmp/${IPFSNODEID}/_MySwarm.staom + echo "############################################ MY MAP " ls ~/.zen/tmp/${IPFSNODEID}/ echo "############################################" diff --git a/_12345.sh b/_12345.sh index e24ca569..d07b5d8b 100755 --- a/_12345.sh +++ b/_12345.sh @@ -175,13 +175,15 @@ while true; do # TODO : SPEEDUP REFRESH COMPARE _MySwarm.moats AND KEEP LASTEST fi - ZMOATS=$(cat ~/.zen/tmp/swarm/${znod}/_MySwarm.moats) + ZMOATS=$(cat ~/.zen/tmp/swarm/${znod}/_MySwarm.moats 2>/dev/null) MOATS_SECONDS=$(${MY_PATH}/tools/MOATS2seconds.sh ${MOATS}) ZMOATS_SECONDS=$(${MY_PATH}/tools/MOATS2seconds.sh ${ZMOATS}) DIFF_SECONDS=$((MOATS_SECONDS - ZMOATS_SECONDS)) if [ ${DIFF_SECONDS} -gt $(( 3 * 24 * 60 * 60 )) ]; then echo "STATION IS STUCK... FOR TOO LONG... REMOVING FROM SWARM" rm -Rf ~/.zen/tmp/swarm/${znod}/ + else + echo "${DIFF_SECONDS} seconds old" fi done