Commit 3b9fb330 authored by alinamihaila's avatar alinamihaila

Add examples of Redis keys

parent 2040d70f
......@@ -19,6 +19,12 @@ module Gitlab
end
end
# Check a basic format for the Redis key in order to ensure the keys are in the same hash slot
#
# Examples of keys
# project:{1}:set_a
# project:{1}:set_b
# project:{2}:set_c
def add(key:, value:, expiry:)
unless %r{\A(\w|-|:)*\{\w*\}(\w|-|:)*\z}.match?(key)
raise KeyFormatError.new("Invalid key format. #{key} key should have changeable parts in curly braces. See https://docs.gitlab.com/ee/development/redis.html#multi-key-commands")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment