<commit_before>require 'travis/addons/handlers/base'
require 'travis/addons/handlers/task'
require 'travis/addons/model/broadcast'

module Travis
  module Addons
    module Handlers
      class LogSearch < Base
        include Handlers::Task

        EVENTS = 'job:finished'

        def handle?
          ENV['LOGSEARCH_ENABLED'] == 'true'
        end

        def handle
          Travis::Sidekiq.logsearch(object.id)
        end

        private

          class EventHandler < Addons::Instrument
            def notify_completed
              publish
            end
          end
          EventHandler.attach_to(self)
      end
    end
  end
end
<commit_msg>Update logsearch.rb<commit_after>require 'travis/addons/handlers/base'
require 'travis/addons/handlers/task'
require 'travis/addons/model/broadcast'

module Travis
  module Addons
    module Handlers
      class LogSearch < Base
        include Handlers::Task

        # alias log_search => logsearch
        register('logsearch', self)

        EVENTS = 'job:finished'

        def handle?
          ENV['LOGSEARCH_ENABLED'] == 'true'
        end

        def handle
          Travis::Sidekiq.logsearch(object.id)
        end

        private

          class EventHandler < Addons::Instrument
            def notify_completed
              publish
            end
          end
          EventHandler.attach_to(self)
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.07158043940467754, 'fraction_numerical': 0.0, 'mean_word_length': 1.875763747454175, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, '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': '2874966', 'n_tokens_mistral': 409, 'n_tokens_neox': 403, 'n_words': 90}