Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
system-design-primer
Commits
40b5be2d
Commit
40b5be2d
authored
Mar 21, 2017
by
Roxas Shadow
Committed by
Donne Martin
Mar 21, 2017
Browse files
Declare variable key in the get_user example (#26)
parent
f1ae855a
Changes
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
40b5be2d
...
...
@@ -1156,6 +1156,7 @@ def get_user(self, user_id):
if user is None:
user = db.query("SELECT * FROM users WHERE user_id = {0}", user_id)
if user is not None:
key = "user.{0}".format(user_id)
cache.set(key, json.dumps(user))
return user
```
...
...
Write
Preview
Supports
Markdown
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