Add more instance stats APIs (#6125)
* Add GET /api/v1/instance/peers API to reveal known domains * Add GET /api/v1/instance/activity API * Make new APIs disableable, exclude private statuses from activity stats * Fix code style issue * Fix week timestamps
This commit is contained in:
		@@ -121,4 +121,13 @@ class ApplicationController < ActionController::Base
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def render_cached_json(cache_key, **options)
 | 
			
		||||
    data = Rails.cache.fetch(cache_key, { raw: true }.merge(options)) do
 | 
			
		||||
      yield.to_json
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    expires_in options[:expires_in], public: true
 | 
			
		||||
    render json: data
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user