Skip to content
Snippets Groups Projects
Commit c52ced56 authored by Kevin Hill's avatar Kevin Hill
Browse files

turned renderAll into batch processing

parent 4d1e9a0c
No related branches found
No related tags found
No related merge requests found
/* jshint node:true */
 
import _ from 'lodash';
import gulp from 'gulp';
import args from 'yargs';
import bump from 'gulp-bump';
Loading
Loading
@@ -8,6 +7,8 @@ import replace from 'gulp-replace';
import compile from './gulp-functions/Compile';
import renderChart from './gulp-functions/Renderer';
import getChartTypes from './gulp-functions/GetChartTypes';
import { map as promiseMap } from 'bluebird';
import { map, head, chunk } from 'lodash';
 
gulp.task('default', ['dev']);
 
Loading
Loading
@@ -73,13 +74,15 @@ gulp.task('render', done => {
*/
gulp.task('renderAll', done => {
getChartTypes(chartTypes => {
Promise.all(_.map(chartTypes, renderChart))
.then(() => {
done();
})
.catch(err => {
console.log(err);
});
promiseMap(chartTypes, chartType => {
return renderChart(chartType);
}, {concurrency: 3})
.then(() => {
done();
})
.catch(err => {
console.log(err);
});
});
});
 
Loading
Loading
Loading
Loading
@@ -17,6 +17,7 @@
"@angular/core": "^4.2.4",
"babel-preset-es2015": "^6.24.1",
"babelify": "^7.3.0",
"bluebird": "^3.5.0",
"browser-sync": "^2.18.12",
"browserify": "^14.4.0",
"browserify-versionify": "^1.0.6",
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment