summaryrefslogtreecommitdiff
path: root/app/models/event.rb
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-11-23 14:14:04 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2016-11-23 14:17:07 +0100
commit5371da341e9d7768ebab8e159b3e2cc8fad1d827 (patch)
tree0de89ef24150fb103846ea5a89ef07b3969fe655 /app/models/event.rb
parentd7eeb6df51ffe2ad864ef49d0e465b88ab158520 (diff)
downloadgitlab-ce-5371da341e9d7768ebab8e159b3e2cc8fad1d827.tar.gz
Remove event caching code
Flushing the events cache worked by updating a recent number of rows in the "events" table. This has the result that on PostgreSQL a lot of dead tuples are produced on a regular basis. This in turn means that PostgreSQL will spend considerable amounts of time vacuuming this table. This in turn can lead to an increase of database load. For GitLab.com we measured the impact of not using events caching and found no measurable increase in response timings. Meanwhile not flushing the events cache lead to the "events" table having no more dead tuples as now rows are only inserted into this table. As a result of this we are hereby removing events caching as it does not appear to help and only increases database load. For more information see the following comment: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6578#note_18864037
Diffstat (limited to 'app/models/event.rb')
-rw-r--r--app/models/event.rb6
1 files changed, 0 insertions, 6 deletions
diff --git a/app/models/event.rb b/app/models/event.rb
index 21eaca917b8..216dba46e74 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -43,12 +43,6 @@ class Event < ActiveRecord::Base
scope :for_milestone_id, ->(milestone_id) { where(target_type: "Milestone", target_id: milestone_id) }
class << self
- def reset_event_cache_for(target)
- Event.where(target_id: target.id, target_type: target.class.to_s).
- order('id DESC').limit(100).
- update_all(updated_at: Time.now)
- end
-
# Update Gitlab::ContributionsCalendar#activity_dates if this changes
def contributions
where("action = ? OR (target_type in (?) AND action in (?))",