<commit_before>module Leaderboard
  class Connection
    class << self
      def query(text)
        client.abandon_results!
        client.query(text, as: :array)
      end

      private

      def client
        @client ||= Mysql2::Client.new(
          (DB_CONFIG["bot_#{ENV['RAILS_ENV']}"] || {}).merge(flags: Mysql2::Client::MULTI_STATEMENTS)
        )
      end
    end
  end
end<commit_msg>Add reconnect option to mysql connection<commit_after>module Leaderboard
  class Connection
    class << self
      def query(text)
        client.abandon_results!
        client.query(text, as: :array)
      end

      private

      def client
        @client ||= Mysql2::Client.new(
          (DB_CONFIG["bot_#{ENV['RAILS_ENV']}"] || {}).merge(flags: Mysql2::Client::MULTI_STATEMENTS, reconnect: true)
        )
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.11904761904761904, 'fraction_numerical': 0.004761904761904762, 'mean_word_length': 2.44672131147541, 'pattern_counts': {'":': 0, '<': 7, '<?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': '217676', 'n_tokens_mistral': 274, 'n_tokens_neox': 267, 'n_words': 56}