-
Notifications
You must be signed in to change notification settings - Fork 897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow overriding memcache server setting by environment variable #15326
Conversation
Checked commit bdunne@f2fd7ff with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@@ -2,6 +2,10 @@ | |||
require 'linux_admin' | |||
|
|||
module MiqMemcached | |||
def self.server_address | |||
ENV["MEMCACHED_SERVER"] || ::Settings.session.memcache_server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is just for containers should we use the ENV["CONTAINER"]
here and just switch this directly to using ENV["MEMCACHED_SERVICE_NAME"]
which is the variable this is already exposed as in the container?
Or even just s/SERVER/SERVICE_NAME/
and assume it won't be there in any other environment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, MEMCACHED_SERVICE_NAME
is only "memcached". It doesn't include the port. I was trying to make this a more generic solution, like how Rails uses DATABASE_URL
.
LGTM |
MiqMemcached.server_address was introduced in ManageIQ#15326 which is not in fine
MiqMemcached.server_address was introduced in ManageIQ#15326 which is not in fine
In a production container environment, we want to set an environment variable to give the app the memcached server address and port rather than writing
config/settings/production.yml
since that file is checked in and could conflict.