<commit_before>module Restforce

  module DB

    # Restforce::DB::Worker represents the primary polling loop through which
    # all record synchronization occurs.
    class Worker

      DEFAULT_INTERVAL = 5

      class << self

        # Public: Store the list of currently open file descriptors so that they
        # may be reopened when a new process is spawned.
        #
        # Returns nothing.
        def before_fork
          return if @files_to_reopen

          @files_to_reopen = []
          ObjectSpace.each_object(File) do |file|
            @files_to_reopen << file unless file.closed?
          end
        end

        # Public: Reopen all file descriptors that have been stored through the
        # before_fork hook.
        #
        # Returns nothing.
        def after_fork
          @files_to_reopen.each do |file|
            begin
              file.reopen file.path, "a+"
              file.sync = true
            rescue ::Exception # rubocop:disable HandleExceptions, RescueException
            end
          end
        end

      end

      attr_accessor :logger, :tracker

      # Public: Initialize a new Restforce::DB::Worker.
      #
      # options - A Hash of options to configure the worker's run. Currently
      #           supported options are:
      #           interval - The maximum polling loop rest time.
      #           config   - The path to a client configuration file.
      #           verbose  - Display command line output? Defaults to false.
      def initialize(options = {})
        @verbose = options.fetch(:verbose) { false }
        @interval = options.fetch(:interval) { DEFAULT_INTERVAL }

        Restforce::DB.configure { |config| config.parse(options[:config]) }
      end
<commit_msg>Ensure that worker configuration loads properly<commit_after>module Restforce

  module DB

    # Restforce::DB::Worker represents the primary polling loop through which
    # all record synchronization occurs.
    class Worker

      DEFAULT_INTERVAL = 5

      class << self

        # Public: Store the list of currently open file descriptors so that they
        # may be reopened when a new process is spawned.
        #
        # Returns nothing.
        def before_fork
          return if @files_to_reopen

          @files_to_reopen = []
          ObjectSpace.each_object(File) do |file|
            @files_to_reopen << file unless file.closed?
          end
        end

        # Public: Reopen all file descriptors that have been stored through the
        # before_fork hook.
        #
        # Returns nothing.
        def after_fork
          @files_to_reopen.each do |file|
            begin
              file.reopen file.path, "a+"
              file.sync = true
            rescue ::Exception # rubocop:disable HandleExceptions, RescueException
            end
          end
        end

      end

      attr_accessor :logger, :tracker

      # Public: Initialize a new Restforce::DB::Worker.
      #
      # options - A Hash of options to configure the worker's run. Currently
      #           supported options are:
      #           interval - The maximum polling loop rest time.
      #           config   - The path to a client configuration file.
      #           verbose  - Display command line output? Defaults to false.
      def initialize(options = {})
        @verbose = options.fetch(:verbose) { false }
        @interval = options.fetch(:interval) { DEFAULT_INTERVAL }

        Restforce::DB.reset
        Restforce::DB.configure { |config| config.parse(options[:config]) }
      end

{'fraction_non_alphanumeric': 0.06787709497206704, 'fraction_numerical': 0.0005586592178770949, 'mean_word_length': 1.8693910256410255, 'pattern_counts': {'":': 0, '<': 11, '<?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': '2613830', 'n_tokens_mistral': 929, 'n_tokens_neox': 883, 'n_words': 310}