Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-pipeline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-pipeline
Commits
089545ee
Commit
089545ee
authored
Aug 27, 2011
by
mattdennewitz
Committed by
Timothée Peignier
Aug 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add configurable cache timeout value, default is 2 year.
Signed-off-by: Timothée Peignier <timothee.peignier@tryphon.org>
parent
f5a902bf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
pipeline/conf/settings.py
+2
-0
pipeline/signals.py
+4
-1
pipeline/versioning/__init__.py
+1
-1
No files found.
pipeline/conf/settings.py
View file @
089545ee
...
@@ -15,6 +15,8 @@ PIPELINE_VERSION_DEFAULT = getattr(settings, 'PIPELINE_VERSION_DEFAULT', '0')
...
@@ -15,6 +15,8 @@ PIPELINE_VERSION_DEFAULT = getattr(settings, 'PIPELINE_VERSION_DEFAULT', '0')
PIPELINE_VERSION_REMOVE_OLD
=
getattr
(
settings
,
'PIPELINE_VERSION_REMOVE_OLD'
,
True
)
PIPELINE_VERSION_REMOVE_OLD
=
getattr
(
settings
,
'PIPELINE_VERSION_REMOVE_OLD'
,
True
)
PIPELINE_VERSIONING
=
getattr
(
settings
,
'PIPELINE_VERSIONING'
,
'pipeline.versioning.mtime.MTimeVersioning'
)
PIPELINE_VERSIONING
=
getattr
(
settings
,
'PIPELINE_VERSIONING'
,
'pipeline.versioning.mtime.MTimeVersioning'
)
PIPELINE_CACHE_TIMEOUT
=
getattr
(
settings
,
'PIPELINE_CACHE_TIMEOUT'
,
63072000
)
PIPELINE_STORAGE
=
getattr
(
settings
,
'PIPELINE_STORAGE'
,
PIPELINE_STORAGE
=
getattr
(
settings
,
'PIPELINE_STORAGE'
,
'pipeline.storage.PipelineStorage'
)
'pipeline.storage.PipelineStorage'
)
...
...
pipeline/signals.py
View file @
089545ee
...
@@ -3,6 +3,8 @@ import os
...
@@ -3,6 +3,8 @@ import os
from
django.core.cache
import
cache
from
django.core.cache
import
cache
from
django.dispatch
import
Signal
,
receiver
from
django.dispatch
import
Signal
,
receiver
from
pipeline.conf
import
settings
css_compressed
=
Signal
(
providing_args
=
[
"package"
,
"version"
])
css_compressed
=
Signal
(
providing_args
=
[
"package"
,
"version"
])
js_compressed
=
Signal
(
providing_args
=
[
"package"
,
"version"
])
js_compressed
=
Signal
(
providing_args
=
[
"package"
,
"version"
])
...
@@ -12,4 +14,5 @@ js_compressed = Signal(providing_args=["package", "version"])
...
@@ -12,4 +14,5 @@ js_compressed = Signal(providing_args=["package", "version"])
@receiver
(
js_compressed
)
@receiver
(
js_compressed
)
def
invalidate_cache
(
sender
,
package
,
version
,
**
kwargs
):
def
invalidate_cache
(
sender
,
package
,
version
,
**
kwargs
):
filename_base
,
filename
=
os
.
path
.
split
(
package
[
'output'
])
filename_base
,
filename
=
os
.
path
.
split
(
package
[
'output'
])
cache
.
set
(
"pipeline:
%
s"
%
filename
,
str
(
version
))
cache
.
set
(
"pipeline:
%
s"
%
filename
,
str
(
version
),
settings
.
PIPELINE_CACHE_TIMEOUT
)
pipeline/versioning/__init__.py
View file @
089545ee
...
@@ -30,7 +30,7 @@ class Versioning(object):
...
@@ -30,7 +30,7 @@ class Versioning(object):
if
match
and
match
.
groups
():
if
match
and
match
.
groups
():
version
=
match
.
group
(
1
)
version
=
match
.
group
(
1
)
break
break
cache
.
set
(
"pipeline:
%
s"
%
filename
,
version
)
cache
.
set
(
"pipeline:
%
s"
%
filename
,
version
,
settings
.
PIPELINE_CACHE_TIMEOUT
)
return
str
(
version
)
return
str
(
version
)
def
output_filename
(
self
,
filename
,
version
):
def
output_filename
(
self
,
filename
,
version
):
...
...
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