<commit_before>require 'aws/sqs'

module Chore
  class SQSConsumer < Consumer

    def initialize(queue_name, opts={})
      super(queue_name, opts)
      @sqs = AWS::SQS.new(
        :access_key_id => Chore.config.aws_access_key,
        :secret_access_key => Chore.config.aws_secret_key)
      @queue = @sqs.queues.named(@queue_name)
      @dupes = DuplicateDetector.new(Chore.config.dedupe_servers || nil)
    end

    def consume(&handler)
      while running?
        begin
          msg = @queue.receive_messages(:limit => 10)<commit_msg>Expose configuration for dedupe server list.<commit_after>require 'aws/sqs'

module Chore
  class SQSConsumer < Consumer
    Chore::CLI.register_option 'dedupe_servers', '--dedupe-servers', 'List of mememcache compatible server(s) to use for storing SQS Message Dedupe cache'

    def initialize(queue_name, opts={})
      super(queue_name, opts)
      @sqs = AWS::SQS.new(
        :access_key_id => Chore.config.aws_access_key,
        :secret_access_key => Chore.config.aws_secret_key)
      @queue = @sqs.queues.named(@queue_name)
      @dupes = DuplicateDetector.new(Chore.config.dedupe_servers || nil)
    end

    def consume(&handler)
      while running?
        begin
          msg = @queue.receive_messages(:limit => 10)
{'fraction_non_alphanumeric': 0.11224489795918367, 'fraction_numerical': 0.0031397174254317113, 'mean_word_length': 3.292929292929293, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '7301994', 'n_tokens_mistral': 436, 'n_tokens_neox': 419, 'n_words': 84}