lib/flapjack/processor.rb in flapjack-0.8.7 vs lib/flapjack/processor.rb in flapjack-0.8.8
- old
+ new
@@ -34,11 +34,11 @@
@archive_events = @config['archive_events'] || false
@events_archive_maxage = @config['events_archive_maxage']
ncsm_duration_conf = @config['new_check_scheduled_maintenance_duration'] || '100 years'
- @ncsm_duration = ChronicDuration.parse(ncsm_duration_conf)
+ @ncsm_duration = ChronicDuration.parse(ncsm_duration_conf, :keep_zero => true)
@exit_on_queue_empty = !! @config['exit_on_queue_empty']
options = { :logger => opts[:logger], :redis => @redis }
@filters = []
@@ -194,10 +194,10 @@
previous_state = entity_check.state
if previous_state.nil?
@logger.info("No previous state for event #{event.id}")
- if @ncsm_duration >= 0
+ if @ncsm_duration > 0
@logger.info("Setting scheduled maintenance for #{time_period_in_words(@ncsm_duration)}")
entity_check.create_scheduled_maintenance(timestamp,
@ncsm_duration, :summary => 'Automatically created for new check')
end