Коммит 02d1df3f создал по автору Stan Hu's avatar Stan Hu
Просмотр файлов

Fix memory leak with use of RequestStore

Use RequestStore.store to ensure objects are cleared out properly via
`RequestStore#clear!`
владелец a330b29b
......@@ -30,6 +30,7 @@ v 8.11.0 (unreleased)
- Change requests_profiles resource constraint to catch virtually any file
v 8.10.3 (unreleased)
- Fix memory leak with use of RequestStore
v 8.10.2
- User can now search branches by name. !5144
......
......@@ -263,17 +263,17 @@ def current_project_path
private
def project_refs_cache
RequestStore[:banzai_project_refs] ||= {}
RequestStore.store[:banzai_project_refs] ||= {}
end
def find_objects_cache
RequestStore[:banzai_find_objects_cache] ||= Hash.new do |hash, key|
RequestStore.store[:banzai_find_objects_cache] ||= Hash.new do |hash, key|
hash[key] = Hash.new { |h, k| h[k] = {} }
end
end
def url_for_object_cache
RequestStore[:banzai_url_for_object] ||= Hash.new do |hash, key|
RequestStore.store[:banzai_url_for_object] ||= Hash.new do |hash, key|
hash[key] = Hash.new { |h, k| h[k] = {} }
end
end
......
......@@ -93,7 +93,7 @@ def default_issues_tracker?
private
def default_issues_tracker_cache
RequestStore[:banzai_default_issues_tracker_cache] ||= {}
RequestStore.store[:banzai_default_issues_tracker_cache] ||= {}
end
end
end
......
......@@ -227,7 +227,7 @@ def lazy(&block)
end
def collection_cache
RequestStore[:banzai_collection_cache] ||= Hash.new do |hash, key|
RequestStore.store[:banzai_collection_cache] ||= Hash.new do |hash, key|
hash[key] = {}
end
end
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать