Skip to content

Commit

Permalink
fix broken hardcaches
Browse files Browse the repository at this point in the history
  • Loading branch information
RouxRC committed Feb 13, 2022
1 parent 36efc69 commit e88459e
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bin/hardcache_api_url.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ mkdir -p $DIR

for f in xml json csv; do
rm $DIR/$f.html 2> /dev/null
curl -qL "$URL/$f?_sf_ignore_cache=$$" > $TMPFILE
curl -kqL "$URL/$f?_sf_ignore_cache=$$" > $TMPFILE
mv $TMPFILE $DIR/$f.html
done

Expand Down
2 changes: 1 addition & 1 deletion bin/hardcache_url.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ TMPFILE=/tmp/hard_cache_url.$$
mkdir -p $DIR

rm -f $DIR/$FIL.html 2> /dev/null
curl -qL "$URL?_sf_ignore_cache=$$" > $TMPFILE
curl -kqL "$URL?_sf_ignore_cache=$$" > $TMPFILE
mv $TMPFILE $DIR/$FIL.html

echo $URL $DIR $FIL
4 changes: 2 additions & 2 deletions bin/update_hardcache
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mkdir -p web/synthesetri
for url in synthese synthesetri/10 synthesetri/11 synthesetri/12 synthesetri/13 synthesetri/1 synthesetri/2 synthesetri/3 synthesetri/4 synthesetri/5 synthesetri/6 synthesetri/7 synthesetri/8 synthesetri/9;
do
rm web/$url.html
curl -sL --max-time 90 "http://$VHOST/$url?_sf_ignore_cache=$$" > $TMPFILE 2>> /tmp/update_curl_output.txt
curl -ksL --max-time 90 "http://$VHOST/$url?_sf_ignore_cache=$$" > $TMPFILE 2>> /tmp/update_curl_output.txt
mv $TMPFILE web/$url.html
done;

Expand All @@ -15,7 +15,7 @@ for seance_id in $(echo "select DISTINCT seance_id from intervention where creat
do
echo "http://$VHOST/$LEGISLATURE/seance/$seance_id"
rm web/$LEGISLATURE/seance/$seance_id.html 2> /dev/null
curl -sL "http://$VHOST/$LEGISLATURE/seance/$seance_id?_sf_ignore_cache=$$" > $TMPFILE
curl -ksL "http://$VHOST/$LEGISLATURE/seance/$seance_id?_sf_ignore_cache=$$" > $TMPFILE
mv $TMPFILE web/$LEGISLATURE/seance/$seance_id.html
done
rm -f cache/frontend/prod/template/*/all/intervention/seance/seance/*
Expand Down
4 changes: 2 additions & 2 deletions bin/update_hardcache_all
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ TMPFILE=/tmp/hard_cache.$$
for url in synthese synthesetri/10 synthesetri/11 synthesetri/12 synthesetri/13 synthesetri/1 synthesetri/2 synthesetri/3 synthesetri/4 synthesetri/5 synthesetri/6 synthesetri/7 synthesetri/8 synthesetri/9;
do
rm web/$url.html
curl -sL http://$VHOST/$url > $TMPFILE
curl -ksL http://$VHOST/$url > $TMPFILE
mv $TMPFILE web/$url.html
done;

for seance_id in $(echo "select DISTINCT seance_id from presence order by seance_id" | mysql $MYSQLID $DBNAME | grep -v seance_id )
do
echo "http://$VHOST/$LEGISLATURE/seance/$seance_id"
rm web/$LEGISLATURE/seance/$seance_id.html 2> /dev/null
curl -sL http://$VHOST/$LEGISLATURE/seance/${seance_id}?_sf_ignore_cache=1 > $TMPFILE
curl -ksL http://$VHOST/$LEGISLATURE/seance/${seance_id}?_sf_ignore_cache=1 > $TMPFILE
mv $TMPFILE web/$LEGISLATURE/seance/$seance_id.html
done
rm -rf cache/frontend/prod/template/*/all/intervention/seance/seance
Expand Down
2 changes: 1 addition & 1 deletion bin/update_hardcache_hemicycle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ for seance_id in $(echo "select DISTINCT id from seance where type = 'hemicycle'
do
echo "http://$VHOST/$LEGISLATURE/seance/$seance_id"
rm web/$LEGISLATURE/seance/$seance_id.html 2> /dev/null
curl -sL http://$VHOST/$LEGISLATURE/seance/$seance_id > TMPFILE
curl -ksL http://$VHOST/$LEGISLATURE/seance/$seance_id > TMPFILE
mv TMPFILE web/$LEGISLATURE/seance/$seance_id.html
done
rm cache/frontend/prod/template/*/all/intervention/seance/seance/*
Expand Down
2 changes: 1 addition & 1 deletion bin/update_hardcache_one
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ seance_id=$1

echo "http://$VHOST/$LEGISLATURE/seance/$seance_id"
rm web/$LEGISLATURE/seance/$seance_id.html 2> /dev/null
curl -sL http://$VHOST/$LEGISLATURE/seance/${seance_id}?_sf_ignore_cache=$$ > $TMPFILE
curl -ksL http://$VHOST/$LEGISLATURE/seance/${seance_id}?_sf_ignore_cache=$$ > $TMPFILE
mv $TMPFILE web/$LEGISLATURE/seance/$seance_id.html

2 changes: 1 addition & 1 deletion bin/update_latest_seances_hardcache
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ for seance_id in $(echo "select DISTINCT seance_id from intervention where updat
do
echo "http://$VHOST/$LEGISLATURE/seance/$seance_id"
rm web/$LEGISLATURE/seance/$seance_id.html 2> /dev/null
curl -s "http://$VHOST/$LEGISLATURE/seance/$seance_id?_sf_ignore_cache=$$" > $TMPFILE
curl -ks "http://$VHOST/$LEGISLATURE/seance/$seance_id?_sf_ignore_cache=$$" > $TMPFILE
mv $TMPFILE web/$LEGISLATURE/seance/$seance_id.html
done
rm -f cache/frontend/prod/template/*/all/intervention/seance/seance/*
Expand Down

0 comments on commit e88459e

Please sign in to comment.