<commit_before>#!/bin/bash
function die {
    echo >&2 "$@"
    exit 1
}

#######################################
# Echo/log function
# Arguments:
#   String: value to log
#######################################
log() {
  if [[ "$@" ]]; then echo "[`date +'%Y-%m-%d %T'`] $@";
  else echo; fi
}

safe_reload() {
  echo "[`date +'%Y-%m-%d %T'`] nginx safe reload"

  nginx -t &&
    service nginx reload # only runs if nginx -t succeeds
}

rm -f /etc/nginx/sites-enabled/server.conf

if [ -z "$SERVER_CONF" ] ; then
   cp /root/server.conf /etc/nginx/sites-enabled/server.conf
else
   curl -SL $SERVER_CONF --output /etc/nginx/sites-enabled/server.conf
fi

safe_reload()<commit_msg>another attempt<commit_after>#!/bin/bash
function die {
    echo >&2 "$@"
    exit 1
}

#######################################
# Echo/log function
# Arguments:
#   String: value to log
#######################################
log() {
  if [[ "$@" ]]; then echo "[`date +'%Y-%m-%d %T'`] $@";
  else echo; fi
}

rm -f /etc/nginx/sites-enabled/server.conf

if [ -z "$SERVER_CONF" ] ; then
   cp /root/server.conf /etc/nginx/sites-enabled/server.conf
else
   curl -SL $SERVER_CONF --output /etc/nginx/sites-enabled/server.conf
fi

nginx -t && service nginx reload # only runs if nginx -t succeeds
{'fraction_non_alphanumeric': 0.2820109976433621, 'fraction_numerical': 0.003142183817753339, 'mean_word_length': 3.5663082437275984, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '788451', 'n_tokens_mistral': 482, 'n_tokens_neox': 444, 'n_words': 113}