diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-11-28 03:34:12 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-11-28 03:34:12 +0000 |
commit | d8f75233686fe20bff26599704fbcb235f7bb43b (patch) | |
tree | 15a38c9b174b279bac9f917c991e29b0967b9622 /app/models/project.rb | |
parent | eff2404785f58241f947bd7388564f49119d517d (diff) | |
parent | 0ba03d7eb1d80e019b9b8266f0e14356d32e7d69 (diff) | |
download | gitlab-ce-d8f75233686fe20bff26599704fbcb235f7bb43b.tar.gz |
Merge branch 'events-cache-invalidation' into 'master'
Remove caching of events data
This MR removes the caching of events data as this was deemed unnecessary while increasing load on the database. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6578#note_18864037 and 5371da341e9d7768ebab8e159b3e2cc8fad1d827 for more information.
See merge request !6578
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 9256e9ddd95..c61e63461e0 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -976,7 +976,6 @@ class Project < ActiveRecord::Base begin gitlab_shell.mv_repository(repository_storage_path, "#{old_path_with_namespace}.wiki", "#{new_path_with_namespace}.wiki") send_move_instructions(old_path_with_namespace) - reset_events_cache @old_path_with_namespace = old_path_with_namespace @@ -1043,22 +1042,6 @@ class Project < ActiveRecord::Base attrs end - # Reset events cache related to this project - # - # Since we do cache @event we need to reset cache in special cases: - # * when project was moved - # * when project was renamed - # * when the project avatar changes - # Events cache stored like events/23-20130109142513. - # The cache key includes updated_at timestamp. - # Thus it will automatically generate a new fragment - # when the event is updated because the key changes. - def reset_events_cache - Event.where(project_id: self.id). - order('id DESC').limit(100). - update_all(updated_at: Time.now) - end - def project_member(user) project_members.find_by(user_id: user) end |