@@ -16,15 +16,22 @@ 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 } } . execute
21+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_job_queue_length } } . execute
22+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_job_queue_load } } . execute
23+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_failed_job_count } } . execute
24+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_vitals } } . execute
25+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_log_counts } } . execute
26+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_task_stats } } . execute
27+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_deploying_count } } . execute
28+ @update_tasks << Concurrent ::TimerTask . new ( execution_interval : 30 ) { catch_error { update_webserver_stats } } . execute
29+ end
30+
31+ def stop_updates
32+ return unless @update_tasks
33+
34+ @update_tasks . each ( &:shutdown )
2835 end
2936
3037 def update!
0 commit comments