-fs            = require 'fs'
+_  = require 'lodash'
+fs = require 'fs'
+
 { isAllowed } = require './grouptoenvmapping'
 { generateCountlySupervisord } = require './countly/generateConfig'
 

# becareful while editing this function, any change will affect every worker
generateWorkerSection = (app, options = {}) ->

  section =
    command                 : 'command'
    numprocs                : options.instances or 1
    numprocs_start          : 0
    directory               : '%(ENV_KONFIG_PROJECTROOT)s'

    autorestart             : yes
    startsecs               : 10
    startretries            : 5
    stopsignal              : 'TERM'
    stopwaitsecs            : 10
    stopasgroup             : yes
    killasgroup             : yes
