Skip to content

Commit

Permalink
Improve: Improve admin page performance
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi committed Aug 30, 2024
1 parent fd5d825 commit e1e6857
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions backend/app/controllers/api/admin_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ def data
discord: User.where.not(discord_id: nil).count
},
files:
FileResource
.all
.group_by(&:kind)
.transform_values(&:count),
FileResource.kinds.transform_values do |kind|
FileResource.where(kind:).count
end,
db: ActiveRecord::Base.connection_pool.stat
}
}
Expand Down

0 comments on commit e1e6857

Please sign in to comment.