testmycode/tmc-server

View on GitHub
app/controllers/status_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

# Shows the various statistics under /stats.
class StatusController < ApplicationController
  def index
    authorize! :read_instance_state, nil
    @stats = Rails.cache.fetch('submission-stats-cache')
    @stats = JSON.parse(@stats) if @stats
    @sandboxes = Rails.cache.fetch('sandbox-status-cache')
    @sandboxes = JSON.parse(@sandboxes) if @sandboxes
  end
end