Skip to content

Commit

Permalink
fix memory leak where config array grew unbounded
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhawksley committed Jul 1, 2024
1 parent 1d42e04 commit 6f9cfe2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/apis/home_assistant_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def package_present?
def unavailable_door_sensors
out = []

Timeframe::Application.config.local["home_assistant"]["exterior_door_sensors"].concat(
(Timeframe::Application.config.local["home_assistant"]["exterior_door_sensors"] +
Timeframe::Application.config.local["home_assistant"]["exterior_door_locks"]
).each do |entity_id|
if data.find { _1[:entity_id] == entity_id }&.fetch(:state) == "unavailable"
Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def self.redis
end
end

config.local = YAML.load_file(Rails.root.join("config.yml"))
config.local = YAML.load_file(Rails.root.join("config.yml")).freeze

# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
Expand Down

0 comments on commit 6f9cfe2

Please sign in to comment.