mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-29 03:16:22 -05:00
Converting map blob to use "custom" postgres dump format so restore can use multiple threads. Renaming map db blob from gis-map.dump.gz to map-db-gis.dump.
This commit is contained in:
parent
3285887a1b
commit
8e4d173791
15 changed files with 37 additions and 24 deletions
|
|
@ -11,7 +11,7 @@ fi
|
|||
# Change directory to avoid "sudo" home directory warning.
|
||||
cd /tmp
|
||||
|
||||
if sudo -iu postgres psql -l 2>/dev/null | grep gis >/dev/null; then
|
||||
if sudo -iu postgres psql --port=5433 -l 2>/dev/null | grep gis >/dev/null; then
|
||||
yes_or_no "Are you sure you want to delete the map database and cache? This can't be undone!" || exit 0
|
||||
fi
|
||||
|
||||
|
|
@ -27,10 +27,10 @@ set -x
|
|||
|
||||
systemctl stop renderd
|
||||
|
||||
sudo -iu postgres dropdb gis || :
|
||||
sudo -iu postgres dropuser _renderd || :
|
||||
sudo -iu postgres dropdb --port=5433 gis || :
|
||||
sudo -iu postgres dropuser --port=5433 _renderd || :
|
||||
|
||||
# Reset "imported" status of any map files.
|
||||
# Reset "imported" status of any map files in API DB.
|
||||
sudo -iu postgres psql -d wrolpi -c "UPDATE map_file SET imported=false"
|
||||
|
||||
yes | /opt/wrolpi/scripts/initialize_map_db.sh
|
||||
|
|
@ -38,15 +38,15 @@ yes | /opt/wrolpi/scripts/initialize_map_db.sh
|
|||
# Use curl to fetch the first few layers of map tiles so the map is ready to use.
|
||||
bash /opt/wrolpi/wrolpi/scripts/initialize_map_tiles.sh
|
||||
|
||||
# Check the hash value of a Washington DC tile from /opt/wrolpi-blobs/gis-map.dump.gz
|
||||
# Check the hash value of a Washington DC tile from /opt/wrolpi-blobs/map-db-gis.dump
|
||||
wget "https://127.0.0.1:8084/hot/13/2345/3134.png" \
|
||||
--quiet \
|
||||
--no-check-certificate \
|
||||
--timeout 600 \
|
||||
-O /tmp/tile.png
|
||||
set +x
|
||||
echo "b9b7884d64b555fd4f433f991a86cc72 /tmp/tile.png" > /tmp/tile.md5
|
||||
if md5sum -c /tmp/tile.md5 >/dev/null ; then
|
||||
echo "58b261940abaf50229544839fc55c83d /tmp/tile.png" > /tmp/tile.md5
|
||||
if md5sum -c /tmp/tile.md5 >/dev/null 2>&1 ; then
|
||||
echo "Map tile was rendered correctly"
|
||||
else
|
||||
echo "Map tile was not rendered correctly!"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue