FEATURE: SKIP_DB_AND_REDIS env var (#7756)

Sometimes we would like to create a base image without any DB access, this
assists in creating custom base images with custom plugins that already
includes `public/assets`

Following this change set you can run:

```
SPROCKETS_CONCURRENT=1 DONT_PRECOMPILE_CSS=1 SKIP_DB_AND_REDIS=1 RAILS_ENV=production bin/rake assets:precompile
```

Then it is straight forward to create a base image without needing a DB or
Redis.
This commit is contained in:
Sam
2019-06-13 12:58:27 +10:00
committed by GitHub
parent 5b55252e10
commit fa2a5f6f56
10 changed files with 57 additions and 5 deletions

View File

@ -245,7 +245,13 @@ module Discourse
end
def self.cache
@cache ||= Cache.new
@cache ||= begin
if GlobalSetting.skip_redis?
ActiveSupport::Cache::MemoryStore.new
else
Cache.new
end
end
end
# Get the current base URL for the current site