# 커스텀 플러그인 때문에 디스코가 과부하 상태입니다. 도와주세요

**URL:** <https://meta.discourse.org/t/our-discourse-overload-because-of-a-custom-plugin-please-help-me/236696>\
**Category:** Self-hosting\
**Tags:** hosting\
**Created:** [8월 20, 2022, 9:49오전 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:** 32

<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:** [8월 22, 2022, 8:54오전 UTC](https://meta.discourse.org/t/our-discourse-overload-because-of-a-custom-plugin-please-help-me/236696/32 "2022-08-22T08:54:53Z")

</div>

아, 죄송하지만 인덱스를 설정하지 않습니다.  
모델은 아래와 같습니다.

```plaintext
module DiscourseRewards
  class Reward < ActiveRecord::Base
    self.table_name = 'discourse_rewards_rewards'

    has_many :user_rewards
    belongs_to :created_by, class_name: 'User'

    default_scope { where(deleted_at: nil) }
  end
end

```

```plaintext
module DiscourseRewards
  class UserPoint < ActiveRecord::Base
    self.table_name = 'discourse_rewards_user_points'

    belongs_to :user
    belongs_to :user_badge
    belongs_to :user_points_category

    def self.user_total_points(user)
      UserPoint.where(user_id: user.id).sum(:reward_points)
    end
  end
end

```

```plaintext
module DiscourseRewards
  class UserReward < ActiveRecord::Base
    self.table_name = 'discourse_rewards_user_rewards'

    belongs_to :user
    belongs_to :reward

    enum status: [:applied, :granted]
  end
end

```

안전 모드에서 모든 플러그인을 비활성화했습니다. 하지만 아시다시피, 데이터베이스는 변경되지 않았습니다. 🥲

---

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