mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 11:25:45 +08:00
a169dc6832
This reverts commit 7217dcb67a
.
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
|