<commit_before>module Prisma
  module Filter
    extend ActiveSupport::Concern

    included do
      before_filter :prisma_disperse_request
    end

    protected

    def prisma_disperse_request
      Prisma.groups.each do |name, group|
        redis_key = Prisma.redis_key(name)
        value = group.block.call(self)
        Prisma.redis.hincrby redis_key, value, 1 if value

        Prisma.redis.expire redis_key, Prisma.redis_expire if Prisma.redis_expiration_duration
      end
    end
  end
end

<commit_msg>Use after_filter instead of before_filter<commit_after>module Prisma
  module Filter
    extend ActiveSupport::Concern

    included do
      after_filter :prisma_disperse_request
    end

    protected

    def prisma_disperse_request
      Prisma.groups.each do |name, group|
        redis_key = Prisma.redis_key(name)
        value = group.block.call(self)
        Prisma.redis.hincrby redis_key, value, 1 if value

        Prisma.redis.expire redis_key, Prisma.redis_expire if Prisma.redis_expiration_duration
      end
    end
  end
end


{'fraction_non_alphanumeric': 0.05476864966949953, 'fraction_numerical': 0.0018885741265344666, 'mean_word_length': 2.911439114391144, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1960456', 'n_tokens_mistral': 379, 'n_tokens_neox': 349, 'n_words': 78}