<commit_before>#!/usr/bin/env bash

mem=$(awk 'NR == 1 { print int($2*.9/1024) } ' /proc/meminfo)
osm2pgsql \
--create \
--hstore-all \
--hstore-add-index \
--extra-attributes \
--slim \
--drop \
--unlogged \
--database='gis' \
-C $mem \
--number-processes $(nproc) $1

echo "EXECUTED: render-db-pbf2render.sh"<commit_msg>render-db-pbf2render.sh finds the latest dump<commit_after>#!/usr/bin/env bash

api_db_dumps_dir=/opt/data/api-db-dumps/

# file in dumps dir with latest timestamp
newest_dump=$(ls -r -1 $api_db_dumps_dir | head -n 1)
newest_dump_path=$api_db_dumps_dir$newest_dump

mem=$(awk 'NR == 1 { print int($2*.9/1024) } ' /proc/meminfo)

osm2pgsql \
--create \
--hstore-all \
--hstore-add-index \
--extra-attributes \
--slim \
--drop \
--unlogged \
--database='gis' \
-C $mem \
--number-processes $(nproc) $newest_dump_path

echo "EXECUTED: render-db-pbf2render.sh"
{'fraction_non_alphanumeric': 0.1947608200455581, 'fraction_numerical': 0.025056947608200455, 'mean_word_length': 3.266990291262136, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2623679', 'n_tokens_mistral': 388, 'n_tokens_neox': 373, 'n_words': 69}