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

set -e

function wait-for-server-connection() {

    local server_port="$1"
    local max_seconds_to_wait="$2"
    i=0
    while ! nc -z 127.0.0.1 $server_port; do
        sleep 1
        echo -n "."
        ((i++)) || true
        if [ $i -gt $max_seconds_to_wait ]; then
            echo
            echo "Server connection timed out"
            exit 1
        fi
    done
    exit 0
}

echo "Running CI build..."
echo
lein ci

echo "Building uberjar..."
echo

lein uberjar

echo "Starting server..."
echo
export PORT=19832
eval $(cat Procfile | cut -c6-) & # Run the Procfile command

timeout_secs=15
echo "Waiting ${timeout_secs} seconds for server to boot up..."
echo
wait-for-server-connection $PORT timeout_secs<commit_msg>Fix ci.sh script finally<commit_after>#!/usr/bin/env bash

set -e

function wait-for-server-connection() {

    local server_port="$1"
    local max_seconds_to_wait="$2"
    i=0
    while ! nc -z 127.0.0.1 $server_port; do
        sleep 1
        echo -n "."
        i=$(expr $i + 1)
        if [ $i -gt $max_seconds_to_wait ]; then
            echo
            echo "Server connection timed out"
            exit 1
        fi
    done
    exit 0
}

echo "Running CI build..."
echo
lein ci

echo "Building uberjar..."
echo

lein uberjar

echo "Starting server..."
echo
export PORT=19832
eval $(cat Procfile | cut -c6-) & # Run the Procfile command

server_pid=%1

timeout_secs=15
echo "Waiting ${timeout_secs} seconds for server to boot up..."
echo
wait-for-server-connection $PORT $timeout_secs

kill $server_pid
{'fraction_non_alphanumeric': 0.11455696202531646, 'fraction_numerical': 0.026582278481012658, 'mean_word_length': 2.356687898089172, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6755612', 'n_tokens_mistral': 570, 'n_tokens_neox': 524, 'n_words': 170}