Class: WorkerKiller::RufusScheduler::OOMLimiter
- Inherits:
-
BaseLimiter
- Object
- BaseLimiter
- WorkerKiller::RufusScheduler::OOMLimiter
- Defined in:
- lib/worker_killer/rufus_scheduler/oom_limiter.rb
Overview
Register rufus process killer by RAM usage.
Instance Attribute Summary
Attributes inherited from BaseLimiter
#frequency, #job_filter, #killer, #limiter, #scheduler, #timeout
Instance Method Summary collapse
-
#initialize(scheduler:, frequency:, timeout:, logger: nil, job_filter: nil, **limiter_kwargs) ⇒ OOMLimiter
constructor
A new instance of OOMLimiter.
Methods inherited from BaseLimiter
#check_after_job?, #register, register, #run_check
Constructor Details
#initialize(scheduler:, frequency:, timeout:, logger: nil, job_filter: nil, **limiter_kwargs) ⇒ OOMLimiter
Returns a new instance of OOMLimiter.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/worker_killer/rufus_scheduler/oom_limiter.rb', line 13 def initialize(scheduler:, frequency:, timeout:, logger: nil, job_filter: nil, **limiter_kwargs) # when frequency parameter used to set how often check should be run, check_cycle is not needed. limiter = ::WorkerKiller::MemoryLimiter.new(check_cycle: 1, **limiter_kwargs) super( scheduler: scheduler, frequency: frequency, timeout: timeout, limiter: limiter, logger: logger, job_filter: job_filter ) end |