Skip to content
Permalink
Browse files

Use _.values instead of Object.values

Object.values is unavailable in older versions of Node.

Object.keys should be fine, but I've replaced it too for consistency.
  • Loading branch information
mwiencek committed May 17, 2017
1 parent 92d365f commit 4f13891686d2a8660e84488cf7125404920f270b
Showing with 3 additions and 2 deletions.
  1. +3 −2 root/server.js
@@ -14,6 +14,7 @@ Raven.config(DBDefs.SENTRY_DSN).install();
const cluster = require('cluster');
const fs = require('fs');
const spawnSync = require('child_process').spawnSync;
const _ = require('lodash');

const createServer = require('./server/createServer');
const gettext = require('./server/gettext');
@@ -46,7 +47,7 @@ if (cluster.isMaster) {

function forkWorker(listening) {
// Allow spawning one additional worker during HUP.
if (Object.keys(cluster.workers).length > WORKER_COUNT) {
if (_.keys(cluster.workers).length > WORKER_COUNT) {
return false;
}

@@ -107,7 +108,7 @@ if (cluster.isMaster) {

const killNext = Raven.wrap(function () {
if (!oldWorkers) {
oldWorkers = Object.values(cluster.workers);
oldWorkers = _.values(cluster.workers);
}
const oldWorker = oldWorkers.pop();
if (oldWorker) {

0 comments on commit 4f13891

Please sign in to comment.
You can’t perform that action at this time.