-
-
Save fjorgemota/9c4cfc406f14de1e7412 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_foo(foo_id): | |
foo = memcached.get("foo:%d" % foo_id) | |
if foo is not None: | |
return foo | |
foo = fetch_foo_from_database(foo_id) | |
memcached.set("foo:%d"% foo_id, foo) | |
return foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment