<commit_before>module PatronusFati
  module MessageProcessor
    extend FactoryBase

    def self.cleanup_models
      @next_cleanup ||= Time.now.to_i + 60

      if @next_cleanup <= Time.now.to_i
        @next_cleanup = Time.now.to_i + 10

        PatronusFati::DataModels::AccessPoint.inactive.reported_online.each do |ap|
          ap.update(:reported_online => false)
          PatronusFati.event_handler.event(:access_point, :offline, {'bssid' => ap.bssid, 'uptime' => ap.uptime})
          ap.disconnect_clients!
          ap.destroy
        end

        PatronusFati::DataModels::Client.inactive.reported_online.each do |cli|<commit_msg>Slow down the garbage collection process to save resources<commit_after>module PatronusFati
  module MessageProcessor
    extend FactoryBase

    def self.cleanup_models
      @next_cleanup ||= Time.now.to_i + 60

      if @next_cleanup <= Time.now.to_i
        @next_cleanup = Time.now.to_i + 30

        PatronusFati::DataModels::AccessPoint.inactive.reported_online.each do |ap|
          ap.update(:reported_online => false)
          PatronusFati.event_handler.event(:access_point, :offline, {'bssid' => ap.bssid, 'uptime' => ap.uptime})
          ap.disconnect_clients!
          ap.destroy
        end

        PatronusFati::DataModels::Client.inactive.reported_online.each do |cli|
{'fraction_non_alphanumeric': 0.10352588147036759, 'fraction_numerical': 0.006001500375093774, 'mean_word_length': 3.079510703363914, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '916404', 'n_tokens_mistral': 438, 'n_tokens_neox': 417, 'n_words': 75}