Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
5931dc72
authored
Nov 18, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common: add logging to method_cache
parent
93a898e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
circle/common/models.py
+6
-0
No files found.
circle/common/models.py
View file @
5931dc72
from
hashlib
import
sha224
from
logging
import
getLogger
from
time
import
time
from
django.contrib.auth.models
import
User
...
...
@@ -9,6 +10,8 @@ from django.utils.translation import ugettext_lazy as _
from
model_utils.models
import
TimeStampedModel
logger
=
getLogger
(
__name__
)
def
activitycontextimpl
(
act
):
try
:
...
...
@@ -105,6 +108,9 @@ def method_cache(memcached_seconds=60, instance_seconds=5): # noqa
# save to memcache and class attr
cache
.
set
(
key
,
result
,
memcached_seconds
)
setattr
(
instance
,
key
,
{
'time'
:
now
,
'value'
:
result
})
logger
.
debug
(
'Value of <
%
s>.
%
s(
%
s)=<
%
s> saved to cache.'
,
unicode
(
instance
),
method
.
__name__
,
unicode
(
args
),
unicode
(
result
))
return
result
return
x
...
...
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