# עומס הדיון שלנו בגלל פלאגין מותאם אישית. אנא עזרו לי

**URL:** <https://meta.discourse.org/t/our-discourse-overload-because-of-a-custom-plugin-please-help-me/236696>\
**Category:** Self-hosting\
**Tags:** hosting\
**Created:** [20 באוגוסט,‏ 2022,‏ 9:49am UTC](https://meta.discourse.org/t/our-discourse-overload-because-of-a-custom-plugin-please-help-me/236696 "2022-08-20T09:49:57Z")\
**Posts on this page:** 1\
**Showing post:** 30

<div class="post-metadata">

**Author:** ![Alienazk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alienazk/32/261130_2.png) [@Alienazk](https://meta.discourse.org/u/Alienazk)\
**Post date:** [22 באוגוסט,‏ 2022,‏ 8:44am UTC](https://meta.discourse.org/t/our-discourse-overload-because-of-a-custom-plugin-please-help-me/236696/30 "2022-08-22T08:44:07Z")

</div>

I think it is possible the plugins we installed have increased the load.  
The plugin made such a change to the user model that when we go to discovery route, we always calculate the points of user model in topic model for many times

```plaintext
add_to_class(:user, :total_earned_points) do
    self.user_points.sum(:reward_points)
  end

  add_to_class(:user, :available_points) do
    self.total_earned_points - self.user_rewards.sum(:points)
  end

  add_to_class(:user, :rewards) do
    DiscourseRewards::Reward.where(created_by_id: self.id)
  end

  add_to_serializer(:basic_user, :total_earned_points) do
    user&.total_earned_points
  end

  add_to_serializer(:basic_user, :available_points) do
    user&.available_points
  end

  add_to_serializer(:current_user, :total_earned_points) do
    scope.user.total_earned_points
  end

  add_to_serializer(:current_user, :available_points) do
    scope.user.available_points
  end

  add_to_serializer(:current_user, :user_rewards) do
    scope.user.user_rewards
  end

  add_to_serializer(:current_user, :rewards) do
    scope.user.rewards
  end

```

---

_[View the full topic](https://meta.discourse.org/t/our-discourse-overload-because-of-a-custom-plugin-please-help-me/236696)._
