<commit_before>defmodule Vivaldi do

  require Logger

  alias Vivaldi.Peer.Supervisor

  def main(argv) do
    {options, _, _} = OptionParser.parse(argv)
    
    node_id = options[:nodeid] |> String.to_atom()
    node_name = options[:nodename] |> String.to_atom()
    cookie = options[:cookie] |> String.to_atom()
    controller_name = options[:controllername] |> String.to_atom()
    
    {:ok, _pid} = Node.start(node_name)
    Node.set_cookie(cookie)

    Logger.info "#{node_id} - Started node #{Node.self}"

    case Node.connect(controller_name) do 
      true ->
        Supervisor.start_link(node_id)

        # I couldn't get distillery to work. 
        # So here's a hack to keep the application running 
        # until we collect enough data for the experiment. 
        :timer.sleep(1000 * 86400)
      _ ->
        Logger.error "Could not connect to controller. Exiting..."
    end


  end
  
end
<commit_msg>Remove unused code.<commit_after>defmodule Vivaldi do

  require Logger

  alias Vivaldi.Peer.Supervisor

  def main(argv) do
    {options, _, _} = OptionParser.parse(argv)
    
    node_id = options[:nodeid] |> String.to_atom()
    node_name = options[:nodename] |> String.to_atom()
    cookie = options[:cookie] |> String.to_atom()
    
    {:ok, _pid} = Node.start(node_name)
    Node.set_cookie(cookie)

    Logger.info "#{node_id} - #{Node.self} is up!. Waiting for controller to connect..."

    Supervisor.start_link(node_id)

    # This is a hack. Don't exit since controller will connect soon!
    :timer.sleep(1000 * 86400)
  end
  
end

{'fraction_non_alphanumeric': 0.11697393515575334, 'fraction_numerical': 0.01144310235219326, 'mean_word_length': 2.905707196029777, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '1423220', 'n_tokens_mistral': 541, 'n_tokens_neox': 506, 'n_words': 126}