From 49051775ab95f258850a3fe5549d0af2dcdef927 Mon Sep 17 00:00:00 2001 From: Simon Coles Date: Sun, 6 Oct 2024 09:07:21 +0100 Subject: [PATCH] Disable background threads for now --- config/initializers/mqtt_tasks.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/config/initializers/mqtt_tasks.rb b/config/initializers/mqtt_tasks.rb index d8b17c9..b13ad1c 100644 --- a/config/initializers/mqtt_tasks.rb +++ b/config/initializers/mqtt_tasks.rb @@ -3,19 +3,19 @@ # Putting this in an after_initialize block so we can be sure Rails is loaded Rails.application.config.after_initialize do # Only run these tasks in production, we can do them in development manually - if Rails.env.production? || ENV["FORCE_THREADS"] == "YES" - # The listener thread - Thread.new do - Rails.application.executor.wrap do - MqttMessage.listen - end - end + # if Rails.env.production? || ENV["FORCE_THREADS"] == "YES" + # # The listener thread + # Thread.new do + # Rails.application.executor.wrap do + # MqttMessage.listen + # end + # end - # The pruning thread - Thread.new do - Rails.application.executor.wrap do - MqttMessage.prune_old - end - end - end + # # The pruning thread + # Thread.new do + # Rails.application.executor.wrap do + # MqttMessage.prune_old + # end + # end + # end end