FEATURE: add setting to bypass sending redis CLIENT commands

Some cloud providers (Google Memorystore) do not support any CLIENT commands

By setting :id to nil in the redis config hash we can avoid these commands.

This adds a special global setting GCE users can enable:
`DISCOURSE_REDIS_SKIP_CLIENT_COMMANDS = true`
This commit is contained in:
Sam 2019-01-04 15:08:22 +11:00
parent 8f35fd4595
commit 8b7a2d1cb7
2 changed files with 3 additions and 0 deletions

View File

@ -152,6 +152,7 @@ class GlobalSetting
c[:password] = redis_password if redis_password.present?
c[:db] = redis_db if redis_db != 0
c[:db] = 1 if Rails.env == "test"
c[:id] = nil if redis_skip_client_commands
c.freeze
end

View File

@ -117,6 +117,8 @@ redis_db = 0
# redis password
redis_password =
# skip configuring client id for cloud providers who support no client commands
redis_skip_client_commands = false
# enable Cross-origin Resource Sharing (CORS) directly at the application level
enable_cors = false