.envrc: delete git deploy cache after 24h

This commit is contained in:
cronekorkn 2023-05-04 12:49:57 +02:00
parent 0f74cc8c7e
commit 04a271a1e5
Signed by: cronekorkn
SSH key fingerprint: SHA256:v0410ZKfuO1QHdgKBsdQNF64xmTxOF8osF1LIqwTcVw

12
.envrc
View file

@ -13,9 +13,17 @@ PATH_add bin
python3 -m pip --require-virtualenv --quiet install --upgrade pip wheel
python3 -m pip --require-virtualenv --quiet install --upgrade -r requirements.txt
rm -rf .cache/bw/git_deploy
export BW_GIT_DEPLOY_CACHE=.cache/bw/git_deploy
# git deploy cache
export BW_GIT_DEPLOY_CACHE=".cache/bw/git_deploy"
CREATED_AT=$(stat -f "%Sa" "$BW_GIT_DEPLOY_CACHE" | xargs -I{} date -f '%b %d %H:%M:%S %Y' -j "{}" '+%s')
NOW_AT=$(date +%s)
SECONDS_SINCE=$(expr "$NOW_AT" - "$CREATED_AT")
if [[ "$SECONDS_SINCE" > 86400 ]]
then
rm -rf "$BW_GIT_DEPLOY_CACHE"
fi
mkdir -p "$BW_GIT_DEPLOY_CACHE"
export EXPERIMENTAL_UPLOAD_VIA_CAT=1
export BW_ITEM_WORKERS=32
export BW_NODE_WORKERS=12