Class: Gitlab::Redis::SharedState

Inherits:
Wrapper
  • Object
show all
Defined in:
lib/gitlab/redis/shared_state.rb

Constant Summary collapse

SESSION_NAMESPACE =
'session:gitlab'
USER_SESSIONS_NAMESPACE =
'session:user:gitlab'
USER_SESSIONS_LOOKUP_NAMESPACE =
'session:lookup:user:gitlab'
IP_SESSIONS_LOOKUP_NAMESPACE =
'session:lookup:ip:gitlab2'
DEFAULT_REDIS_SHARED_STATE_URL =
'redis://localhost:6382'
REDIS_SHARED_STATE_CONFIG_ENV_VAR_NAME =
'GITLAB_REDIS_SHARED_STATE_CONFIG_FILE'

Constants inherited from Wrapper

Wrapper::DEFAULT_REDIS_URL, Wrapper::REDIS_CONFIG_ENV_VAR_NAME

Class Method Summary collapse

Methods inherited from Wrapper

_raw_config, config_file_path, #initialize, #params, pool, pool_size, #sentinels, #sentinels?, #url, with

Constructor Details

This class inherits a constructor from Gitlab::Redis::Wrapper

Class Method Details

.config_file_nameObject


21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/gitlab/redis/shared_state.rb', line 21

def config_file_name
  # if ENV set for this class, use it even if it points to a file does not exist
  file_name = ENV[REDIS_SHARED_STATE_CONFIG_ENV_VAR_NAME]
  return file_name if file_name

  # otherwise, if config files exists for this class, use it
  file_name = config_file_path('redis.shared_state.yml')
  return file_name if File.file?(file_name)

  # this will force use of DEFAULT_REDIS_SHARED_STATE_URL when config file is absent
  super
end

.default_urlObject


17
18
19
# File 'lib/gitlab/redis/shared_state.rb', line 17

def default_url
  DEFAULT_REDIS_SHARED_STATE_URL
end

.instrumentation_classObject


34
35
36
# File 'lib/gitlab/redis/shared_state.rb', line 34

def instrumentation_class
  ::Gitlab::Instrumentation::Redis::SharedState
end