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

# wait-for-service.sh

set -e

host="$1"
port="$2"
svc="$3"

echo 'Inspecting ' $host $port

until `telnet $host $port`; do
  >&2 echo "Service is unavailable - sleeping"
  sleep 5
done

>&2 echo "Service is now up, will execute npm run " $svc

npm run $svc<commit_msg>Adding more delay to start services dependent on kafka, so that they don't keep restarting<commit_after>#!/usr/bin/env sh

# wait-for-service.sh

set -e

host="$1"
port="$2"
svc="$3"

echo 'Inspecting ' $host $port

until `telnet $host $port`; do
  >&2 echo "Service is unavailable - sleeping"
  sleep 10s
done

# Additional time to wait till all topics are up
sleep 20s

>&2 echo "Service is now up, will execute npm run " $svc

npm run $svc
{'fraction_non_alphanumeric': 0.12751677852348994, 'fraction_numerical': 0.020134228187919462, 'mean_word_length': 3.9078947368421053, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '907714', 'n_tokens_mistral': 289, 'n_tokens_neox': 269, 'n_words': 104}