@@ -16,15 +16,23 @@ def initialize(start_time, log_counter, logger, statsd_updater, prometheus_updat
1616
1717 def setup_updates
1818 update!
19- Concurrent ::TimerTask . new ( execution_interval : 600 ) { catch_error { update_user_count } } . execute
20- Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_job_queue_length } } . execute
21- Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_job_queue_load } } . execute
22- Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_failed_job_count } } . execute
23- Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_vitals } } . execute
24- Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_log_counts } } . execute
25- Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_task_stats } } . execute
26- Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_deploying_count } } . execute
27- Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_webserver_stats } } . execute
19+ @update_tasks = [ ]
20+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 600 ) { catch_error { update_user_count } }
21+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_job_queue_length } }
22+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_job_queue_load } }
23+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_failed_job_count } }
24+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_vitals } }
25+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_log_counts } }
26+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_task_stats } }
27+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_deploying_count } }
28+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_webserver_stats } }
29+ @update_tasks . each ( &:execute )
30+ end
31+
32+ def stop_updates
33+ return unless @update_tasks
34+
35+ @update_tasks . each ( &:shutdown )
2836 end
2937
3038 def update!
0 commit comments