Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3b9fb330
Commit
3b9fb330
authored
Aug 10, 2020
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add examples of Redis keys
parent
2040d70f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
lib/gitlab/redis/hll.rb
lib/gitlab/redis/hll.rb
+6
-0
No files found.
lib/gitlab/redis/hll.rb
View file @
3b9fb330
...
...
@@ -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"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment