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
9a391107
Commit
9a391107
authored
Dec 10, 2013
by
Rajiv Bose
Committed by
Timothée Peignier
Dec 10, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compilation failover
If multiprocessing and concurrent unspported, render linear compilation.
parent
e9c392dd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
pipeline/compilers/__init__.py
+6
-3
No files found.
pipeline/compilers/__init__.py
View file @
9a391107
...
@@ -22,9 +22,6 @@ class Compiler(object):
...
@@ -22,9 +22,6 @@ class Compiler(object):
return
[
to_class
(
compiler
)
for
compiler
in
settings
.
PIPELINE_COMPILERS
]
return
[
to_class
(
compiler
)
for
compiler
in
settings
.
PIPELINE_COMPILERS
]
def
compile
(
self
,
paths
,
force
=
False
):
def
compile
(
self
,
paths
,
force
=
False
):
import
multiprocessing
from
concurrent
import
futures
def
_compile
(
input_path
):
def
_compile
(
input_path
):
for
compiler
in
self
.
compilers
:
for
compiler
in
self
.
compilers
:
compiler
=
compiler
(
verbose
=
self
.
verbose
,
storage
=
self
.
storage
)
compiler
=
compiler
(
verbose
=
self
.
verbose
,
storage
=
self
.
storage
)
...
@@ -42,6 +39,12 @@ class Compiler(object):
...
@@ -42,6 +39,12 @@ class Compiler(object):
else
:
else
:
return
input_path
return
input_path
try
:
import
multiprocessing
from
concurrent
import
futures
except
ImportError
:
return
list
(
map
(
_compile
,
paths
))
else
:
with
futures
.
ThreadPoolExecutor
(
max_workers
=
multiprocessing
.
cpu_count
())
as
executor
:
with
futures
.
ThreadPoolExecutor
(
max_workers
=
multiprocessing
.
cpu_count
())
as
executor
:
return
list
(
executor
.
map
(
_compile
,
paths
))
return
list
(
executor
.
map
(
_compile
,
paths
))
...
...
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