mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-26 09:56:17 -05:00
Stopping renderd when reseting map db.
Skipping channel import during test unless explicitly requested. Deleting gis database during upgrade, if user agrees. Increasing API verbosity. Using status context to prevent fetching status in useHotspot. Disabling wifi toggle button when pending. Toggling hotspot when clicking nav hotspot icon. Displaying Hotspot status icon in nav menu. Importing channels/favorites after refreshing. Refresh tasks cancel when server shuts down. Bumping version for release speed. Refreshing files is 3x faster. Creating useRecurringTimeout hook which repeatedly calls a callback after a timeout. Changing intervals to timeout so fetches don't stack up while server is loaded. Checking that video file exists before fetching. Creating release candidate branch. Not indexing model associated files.
This commit is contained in:
parent
dbdcc7a57c
commit
6fa6be50fe
32 changed files with 878 additions and 358 deletions
|
|
@ -22,12 +22,12 @@ fi
|
|||
|
||||
if [[ ${1} == *.osm.pbf ]]; then
|
||||
# Import a PBF file.
|
||||
osm2pgsql -d gis --append --slim -G --hstore --tag-transform-script \
|
||||
/opt/openstreetmap-carto/openstreetmap-carto.lua -C 2000 --number-processes 4 \
|
||||
nice -n 18 osm2pgsql -d gis --append --slim -G --hstore --tag-transform-script \
|
||||
/opt/openstreetmap-carto/openstreetmap-carto.lua -C 2000 --number-processes 3 \
|
||||
-S /opt/openstreetmap-carto/openstreetmap-carto.style "${1}"
|
||||
elif [[ ${1} == *.dump ]]; then
|
||||
# Import a Postgresql dump.
|
||||
pg_restore -j4 --no-owner -d gis "${1}"
|
||||
nice -n 18 pg_restore -j3 --no-owner -d gis "${1}"
|
||||
else
|
||||
echo "Cannot import unknown map file"
|
||||
exit 5
|
||||
|
|
|
|||
|
|
@ -18,6 +18,21 @@ apt install -y libboost-all-dev git tar unzip wget bzip2 build-essential autocon
|
|||
/usr/bin/npm install -g carto
|
||||
/usr/bin/carto -v
|
||||
|
||||
function yes_or_no {
|
||||
while true; do
|
||||
read -p "$* [y/n]:" yn
|
||||
case $yn in
|
||||
[Yy]*) return 0 ;;
|
||||
[Nn]*) return 1 ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
sudo -u postgres psql -c '\l' | grep gis &&
|
||||
yes_or_no "Map database already exists. Replace it?" &&
|
||||
systemctl stop renderd &&
|
||||
sudo -u postgres dropdb gis
|
||||
|
||||
# Create `gis` database for map.
|
||||
sudo -u postgres psql -c '\l' | grep gis || sudo -u postgres createdb -E UTF8 -O wrolpi gis
|
||||
sudo -u postgres psql -d gis -c "CREATE EXTENSION postgis;" || :
|
||||
|
|
@ -64,7 +79,7 @@ while [ "${COUNT}" -lt "${MAX_TRIES}" ]; do
|
|||
external_data=true
|
||||
[[ "${dc_import}" = false ]] &&
|
||||
# Run import in "create" mode so basic tables will be created.
|
||||
sudo -u wrolpi osm2pgsql -d gis --create --slim -G --hstore --tag-transform-script \
|
||||
sudo -u wrolpi nice -n 18 osm2pgsql -d gis --create --slim -G --hstore --tag-transform-script \
|
||||
/opt/openstreetmap-carto/openstreetmap-carto.lua -C 2000 --number-processes 4 \
|
||||
-S /opt/openstreetmap-carto/openstreetmap-carto.style /tmp/district-of-columbia-latest.osm.pbf &&
|
||||
dc_import=true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue