Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hold old versions for 48h after they are updated, to make sure all ip… #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ipfs-websites/pin-websites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ project-repos.ipfs.io
dnslink.io
'

ipfs-cluster-ctl $@ pin ls > pinset.txt
ipfs-cluster-ctl $@ pin ls | grep -v -e '-outdated-' > pinset.txt

for s in $websites; do
oldcids=`grep "| $s |" pinset.txt | cut -d ' ' -f 1`
Expand All @@ -51,8 +51,8 @@ for s in $websites; do
pinned=yes
fi
if [[ -n "$oldcid" && ("$newcid" != "$oldcid") ]]; then
echo "unpinning old version: $oldcid"
ipfs-cluster-ctl $@ pin rm --no-status "$oldcid"
echo "unpinning old version after 48h: $oldcid"
ipfs-cluster-ctl $@ pin add --expire-in '48h' --no-status --name "${s}-outdated-$(date --utc -Iseconds)" "$oldcid"
fi
done
done
Expand Down