Sha256: 71e931922941af28d47ace88e38a4c84abddcb51664829420a564bad88073464

Contents?: true

Size: 783 Bytes

Versions: 1

Compression:

Stored size: 783 Bytes

Contents

# frozen_string_literal: true

module WorkerKiller
  module RufusScheduler
    # Register rufus process killer by RAM usage.
    class OOMLimiter < ::WorkerKiller::RufusScheduler::BaseLimiter
      # @param scheduler [Rufus::Scheduler]
      # @param limiter_kwargs [Hash]
      # @param frequency [Integer]
      # @param timeout [Integer]
      # @param logger [Logger,nil]
      def initialize(scheduler:, frequency:, timeout:, logger: nil, **limiter_kwargs)
        # frequency parameter used to set how often check should be run, instead of check_cycle.
        limiter = ::WorkerKiller::MemoryLimiter.new(check_cycle: 1, **limiter_kwargs)
        super(scheduler: scheduler, frequency: frequency, timeout: timeout, limiter: limiter, logger: logger)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
worker_killer-rufus_scheduler-1.0.1 lib/worker_killer/rufus_scheduler/oom_limiter.rb