diff --git a/scripts/import.sh b/scripts/import.sh index 609b0db..ac8fd09 100755 --- a/scripts/import.sh +++ b/scripts/import.sh @@ -17,6 +17,7 @@ usage() { echo " --data-dir PATH Directory to store processed data (default: ./)" echo " --memory SIZE JVM heap size (default: 16g)" echo " --threads NUM Maximum number of import threads (default: half of CPU cores)" + echo " -y, --skip-mem-check Skip memory availability check and warning prompt" echo " -h, --help Show this help message" echo "" echo "Examples:" @@ -40,6 +41,7 @@ THREADS="" PBF_FILE="" # Parse arguments +SKIP_MEM_CHECK=false while [[ $# -gt 0 ]]; do case $1 in --jar-file) @@ -58,6 +60,10 @@ while [[ $# -gt 0 ]]; do THREADS="$2" shift 2 ;; + -y|--skip-mem-check) + SKIP_MEM_CHECK=true + shift + ;; -h|--help) usage ;; @@ -129,7 +135,7 @@ REQUESTED_MEM_GB=$(echo "$MEMORY" | sed 's/[^0-9]//g') echo "System memory: ${AVAILABLE_MEM_GB}GB available" echo "Requested heap: $MEMORY" -if [ "$REQUESTED_MEM_GB" -gt "$AVAILABLE_MEM_GB" ]; then +if [ "$SKIP_MEM_CHECK" = false ] && [ "$REQUESTED_MEM_GB" -gt "$AVAILABLE_MEM_GB" ]; then echo "" echo "⚠️ WARNING: Requested heap size ($MEMORY) exceeds available memory (${AVAILABLE_MEM_GB}GB)" echo " This may cause the process to be killed by the OOM killer." @@ -141,6 +147,8 @@ if [ "$REQUESTED_MEM_GB" -gt "$AVAILABLE_MEM_GB" ]; then echo "Import cancelled." exit 1 fi +elif [ "$SKIP_MEM_CHECK" = true ]; then + echo "Skipping memory check (--skip-mem-check flag used)" fi # Build JVM arguments with memory management optimizations diff --git a/scripts/update.sh b/scripts/update.sh index fe42cb8..db32b08 100644 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -23,10 +23,6 @@ IMPORT_THREADS="${IMPORT_THREADS:-10}" # --- Remote Machine Settings --- REMOTE_BASE_DIR="/opt/paikka/data" -# --- Geocoder API Settings --- -GEOCODER_ADMIN_URL="http://localhost:8080/admin/refresh-db" -GEOCODER_TEST_URL_BASE="http://localhost:8080/v1/reverse" - # Global variables that will be set by parse_args_and_configure or environment REMOTE_USER="" REMOTE_HOST="" @@ -120,6 +116,7 @@ local_create_import_bundle() { --memory "$IMPORT_MEMORY" \ --threads "$IMPORT_THREADS" \ --data-dir "/import/" \ + --skip-mem-check \ "/download/$PBF_FILTERED_FILE" }