Skip to content

Commit

Permalink
Merge pull request #43 from 2gis/fix-gulp-runtime-crash
Browse files Browse the repository at this point in the history
fix crush on runtime
  • Loading branch information
ilfa committed Sep 11, 2014
2 parents 95da888 + ccc2d29 commit 0b326bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var express = require('express'),
cluster = require('cluster'),
cpuCount = require('os').cpus().length,
clc = require('cli-color'),
gulp = require(__dirname + '/gulpfile.js'),
config = require(__dirname + '/build/config.js').appConfig;

//Init application
Expand Down Expand Up @@ -42,6 +41,9 @@ function getParams(req, resp, next) {
next();
}

process.env.isRuntime = true;
var gulp = require(__dirname + '/gulpfile.js');

app.get('/js', getParams, function (req, res) {
var jsStream = gulp.getJS(req.query);
req.dgCallback(jsStream, res);
Expand Down
4 changes: 3 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ var extend = require('extend'),
$.imagemin = require('./build/gulp-imagemin');
$.spritesmith = require('gulp.spritesmith');

require('./build/fixFileCache')($.cache.fileCache, './build/tmp'); // fix file cache due to buggy realization
if (!process.env.isRuntime) {
require('./build/fixFileCache')($.cache.fileCache, './build/tmp'); // fix file cache due to buggy realization
}

var projectList,
errorNotify = function(e) {
Expand Down

0 comments on commit 0b326bf

Please sign in to comment.