Skip to content

Commit 9ac42d4

Browse files
author
Rub21
committed
Remove table evaluation for imposm
1 parent ca6a5a1 commit 9ac42d4

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

images/tiler-imposm/start.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ mkdir -p $imposm3_expire_dir
1818
settingDir=/osm
1919
# Folder to store the imposm expider files in s3 or gs
2020
BUCKET_IMPOSM_FOLDER=imposm
21-
21+
INIT_FILE=/mnt/data/init_done
2222
# Create config file to set variable for imposm
2323
echo "{" > $workDir/config.json
2424
echo "\"cachedir\": \"$cachedir\"," >> $workDir/config.json
@@ -148,23 +148,20 @@ function importData () {
148148
# These index will help speed up tegola tile generation
149149
psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB" -a -f config/postgis_index.sql
150150

151-
touch /mnt/data/init_done
151+
touch $INIT_FILE
152152
# Update the DB
153153
updateData
154154
}
155155

156156

157-
echo "Connecting to DB..."
157+
echo "Connecting to $POSTGRES_HOST DB"
158158
flag=true
159159
while "$flag" = true; do
160160
pg_isready -h $POSTGRES_HOST -p 5432 >/dev/null 2>&2 || continue
161161
# Change flag to false to stop ping the DB
162162
flag=false
163-
hasData=$(psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB" \
164-
-c "SELECT count(*) FROM information_schema.tables WHERE table_schema = 'public'" | sed -n 3p | sed 's/ //g')
165-
# After import there are more than 70 tables
166-
echo "$hasData tables in the DB"
167-
if ([ $hasData \> 70 ] && [[ -f /mnt/data/init_done ]]); then
163+
echo "Check if $INIT_FILE exists"
164+
if ([[ -f $INIT_FILE ]]); then
168165
echo "Update the DB with osm data"
169166
updateData
170167
else

0 commit comments

Comments
 (0)