mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
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.
This commit is contained in:
parent
b32c7df0e9
commit
a169dc6832
27 changed files with 208 additions and 24460 deletions
|
@ -151,6 +151,18 @@ class ThemeJavascriptCompiler
|
|||
class CompileError < StandardError
|
||||
end
|
||||
|
||||
def self.force_default_settings(content, theme)
|
||||
settings_hash = {}
|
||||
theme.settings.each do |setting|
|
||||
settings_hash[setting.name] = setting.default
|
||||
end
|
||||
content.prepend <<~JS
|
||||
(function() {
|
||||
require("discourse/lib/theme-settings-store").registerSettings(#{theme.id}, #{settings_hash.to_json}, { force: true });
|
||||
})();
|
||||
JS
|
||||
end
|
||||
|
||||
attr_accessor :content
|
||||
|
||||
def initialize(theme_id, theme_name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue