-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimisation: Barrier Detail cache (#850)
* optimisation: Barrier Detail cache --------- Co-authored-by: abarolo <[email protected]> Co-authored-by: Uka Osim <[email protected]>
- Loading branch information
1 parent
2f95f87
commit 0cb2bbe
Showing
3 changed files
with
77 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from django.core.cache import cache | ||
|
||
BARRIERS_PREFIX = "barriers/" | ||
|
||
|
||
def get(pk): | ||
return cache.get(f"{BARRIERS_PREFIX}/{pk}") | ||
|
||
|
||
def delete(pk): | ||
cache.delete(f"{BARRIERS_PREFIX}/{pk}") | ||
|
||
|
||
def set(pk, obj): | ||
cache.set(f"{BARRIERS_PREFIX}/{pk}", obj, 120) |
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