<commit_before># encoding utf-8

module Resque
  module TrackingJobs
    module SendSegmentEvent
      @queue = :tracker

      def self.perform(user_id, name, properties)
        return unless key = Cartodb.config[:segment]['api_key']

        segment = Segment::Analytics.new(write_key: key)
        segment.track(user_id: user_id, event: name, properties: properties)
        segment.flush
      rescue => exception
        CartoDB::Logger.warning(message: 'Can\'t report to Segment',
                                exception: exception,
                                event: name,
                                properties: properties)
      end
    end
  end
end<commit_msg>safe fetch config<commit_after># encoding utf-8

module Resque
  module TrackingJobs
    module SendSegmentEvent
      @queue = :tracker

      def self.perform(user_id, name, properties)
        return unless key = Cartodb.get_config(:segment, 'api_key')

        segment = Segment::Analytics.new(write_key: key)
        segment.track(user_id: user_id, event: name, properties: properties)
        segment.flush
      rescue => exception
        CartoDB::Logger.warning(message: 'Can\'t report to Segment',
                                exception: exception,
                                event: name,
                                properties: properties)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08090379008746355, 'fraction_numerical': 0.0014577259475218659, 'mean_word_length': 1.9337606837606838, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4303561', 'n_tokens_mistral': 366, 'n_tokens_neox': 355, 'n_words': 94}