Skip to content

Commit

Permalink
fix(install): crash
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Mar 8, 2019
1 parent 34adbfb commit 4199e03
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 36 deletions.
35 changes: 1 addition & 34 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,41 +189,8 @@ function launchServer (db) {
// return next()
// },
function (next) {
// var pm2 = require('pm2');
// pm2.connect(true, function(err) {
// if (err) throw err;
// pm2.start({
// script: path.join(__dirname, '/src/cache/index.js'),
// name: 'trudesk:cache',
// output: path.join(__dirname, '/logs/cache.log'),
// error: path.join(__dirname, '/logs/cache.log'),
// env: {
// FORK: 1,
// NODE_ENV: global.env
// }
// }, function(err) {
// pm2.disconnect();
// if (err) throw err;
//
// process.on('message', function(message) {
// if (message.data.cache) {
// var nodeCache = require('./src/cache/node-cache');
// global.cache = new nodeCache({
// data: message.data.cache.data,
// checkperiod: 0
// });
// }
// });
//
// next();
// });
// });

var fork = require('child_process').fork
var memLimit = '2048'
if (process.env.MEMORYLIMIT) {
memLimit = process.env.MEMORYLIMIT
}
var memLimit = nconf.get('memlimit') || '2048'

var env = { FORK: 1, NODE_ENV: global.env }
if (isDocker) {
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/api/v1/tickets.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,8 @@ apiTickets.create = function (req, res) {
response.success = true

var postData = req.body
if (!_.isObject(postData)) return res.status(400).json({ success: false, error: 'Invalid Post Data' })
if (!_.isObject(postData) || !postData.subject || !postData.issue)
return res.status(400).json({ success: false, error: 'Invalid Post Data' })

var socketId = _.isUndefined(postData.socketId) ? '' : postData.socketId

Expand Down
3 changes: 2 additions & 1 deletion src/helpers/hbs/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,8 @@ var helpers = {
},

isNotTrue: function (obj, options) {
if (obj === true || obj.toLowerCase() === 'true') return options.inverse(this)
if (obj === true || (typeof obj.toLowerCase === 'function' && obj.toLowerCase() === 'true'))
return options.inverse(this)

return options.fn(this)
},
Expand Down

0 comments on commit 4199e03

Please sign in to comment.