mirror of
https://github.com/discourse/discourse.git
synced 2025-02-15 07:45:02 +00:00
This reverts commit 7217dcb67a59f9c47d655455b60b4e1d8dc30f28. https://meta.discourse.org/t/failed-to-bootstrap-due-to-out-of-memory-killer/188141/18?u=osama Precompiling test_helper.js is so expensive that it can make bootstrap fail on servers with limited resources (2GB RAM). We will find another way that doesn't require much resources.
27 lines
751 B
Ruby
27 lines
751 B
Ruby
# frozen_string_literal: true
|
|
|
|
class QunitController < ApplicationController
|
|
skip_before_action *%i{
|
|
check_xhr
|
|
preload_json
|
|
redirect_to_login_if_required
|
|
}
|
|
layout false
|
|
|
|
# only used in test / dev
|
|
def index
|
|
raise Discourse::InvalidAccess.new if Rails.env.production?
|
|
if (theme_name = params[:theme_name]).present?
|
|
theme = Theme.find_by(name: theme_name)
|
|
raise Discourse::NotFound if theme.blank?
|
|
elsif (theme_url = params[:theme_url]).present?
|
|
theme = RemoteTheme.find_by(remote_url: theme_url)
|
|
raise Discourse::NotFound if theme.blank?
|
|
end
|
|
if theme.present?
|
|
request.env[:resolved_theme_ids] = [theme.id]
|
|
request.env[:skip_theme_ids_transformation] = true
|
|
end
|
|
end
|
|
end
|