-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
452b4b3
commit 595e20d
Showing
8 changed files
with
73 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
connections = {"MYSQL": "mysql+mysqldb://gervasgu:gervasgu@0.0.0.0/FoodOps"} | ||
connections = { | ||
"MYSQL": "mysql+mysqldb://gervasgu:gervasgu@0.0.0.0/FoodOps", | ||
"REDIS": {"host": "localhost", "port": 6379}, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from infrastructure.cache import tab_cache | ||
import json | ||
|
||
|
||
def get_cached(id): | ||
return json.loads(tab_cache.get_value(id)) |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import redis | ||
import ipdb | ||
from config import connections | ||
|
||
|
||
redis_host = connections["REDIS"]["host"] | ||
redis_port = connections["REDIS"]["port"] | ||
|
||
r = redis.Redis(host=redis_host, port=redis_port, decode_responses=True) | ||
|
||
|
||
def get_value(key): | ||
return r.get(key) |
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
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
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
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