Skip to content

Commit

Permalink
Disable background threads for now
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncoles committed Oct 6, 2024
1 parent a61cc61 commit 4905177
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions config/initializers/mqtt_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4905177

Please sign in to comment.