<commit_before>defmodule BartScrape.Scraper do
  use GenServer
  alias BartScrape.{Fetcher, Parser, Recorder}

  def start_link do
    GenServer.start_link(__MODULE__, %{})
  end

  def init(state) do
    schedule_work()
    {:ok, state}
  end

  def handle_info(:work) do
    schedule_work()
    Fetcher.fetch_data |> Parser.parse_data |> Recorder.record_delays
  end

  defp schedule_work() do
    Process.send_after(self(), :work, 0.25 * 60 * 60 * 1000) # 0.25 hrs
  end
end<commit_msg>fixed genserver<commit_after>defmodule BartScrape.Scraper do
  use GenServer
  alias BartScrape.{Fetcher, Parser, Recorder}

  def start_link do
    GenServer.start_link(__MODULE__, %{})
  end

  def init(state) do
    #schedule_work()
    {:ok, state}
  end

  def handle_info(:work, state) do
    #schedule_work()
    Fetcher.fetch_data |> Parser.parse_data |> Recorder.record_delays
    {:noreply, state}
  end

  #defp schedule_work() do
  #   Process.send_after(self(), :work, 0.25 * 60 * 60 * 1000) # 0.25 hrs
  #end
end
{'fraction_non_alphanumeric': 0.1123152709359606, 'fraction_numerical': 0.027586206896551724, 'mean_word_length': 3.618181818181818, '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': '6929040', 'n_tokens_mistral': 409, 'n_tokens_neox': 371, 'n_words': 87}