home_controller.rb 375 B

123456789
  1. # frozen_string_literal: true
  2. class HomeController < ApplicationController
  3. def index
  4. @twitter_count = Rails.cache.fetch('total_twitter_count', expires_in: 15.minutes) { Authorization.where(provider: :twitter).count }
  5. @mastodon_count = Rails.cache.fetch('total_mastodon_count', expires_in: 15.minutes) { Authorization.where(provider: :mastodon).count }
  6. end
  7. end