<commit_before>
class UptimeController < ApplicationController
  before_action :check_token

  def index
    url = sanitized_url

    easy = Curl::Easy.new
    easy.follow_location = true
    easy.max_redirects = 3
    easy.useragent = "curb"
    easy.url = url
    easy.perform

    error_message = nil
<commit_msg>Add a 30s timeout for curl<commit_after>
class UptimeController < ApplicationController
  before_action :check_token

  def index
    url = sanitized_url

    easy = Curl::Easy.new
    easy.follow_location = true
    easy.max_redirects = 3
    easy.useragent = "curb"
    easy.url = url
    easy.timeout = 30
    easy.perform

    error_message = nil

{'fraction_non_alphanumeric': 0.06896551724137931, 'fraction_numerical': 0.008995502248875561, 'mean_word_length': 3.0240963855421685, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4023781', 'n_tokens_mistral': 226, 'n_tokens_neox': 209, 'n_words': 53}