mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
Fix #558
This commit is contained in:
parent
b86194d79b
commit
feda2fd5d3
@ -11,7 +11,7 @@ var p = require('path');
|
||||
* Description
|
||||
* @method exports
|
||||
* @param {} God
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
module.exports = function(God) {
|
||||
|
||||
@ -79,14 +79,12 @@ module.exports = function(God) {
|
||||
* @param {} name
|
||||
* @return arr
|
||||
*/
|
||||
God.findByName = function(name) {
|
||||
God.findByName = function(name) {
|
||||
var db = God.clusters_db;
|
||||
var arr = [];
|
||||
|
||||
for (var key in db) {
|
||||
if (p.basename(God.clusters_db[key].pm2_env.pm_exec_path) == name ||
|
||||
p.basename(God.clusters_db[key].pm2_env.pm_exec_path) == p.basename(name) ||
|
||||
God.clusters_db[key].pm2_env.name == name) {
|
||||
if (God.clusters_db[key].pm2_env.name == name || God.clusters_db[key].pm2_env.pm_exec_path == p.resolve(name)) {
|
||||
arr.push(db[key]);
|
||||
}
|
||||
}
|
||||
@ -98,7 +96,7 @@ module.exports = function(God) {
|
||||
* @method findByScript
|
||||
* @param {} script
|
||||
* @param {} cb
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
God.findByScript = function(script, cb) {
|
||||
var db = God.clusters_db;
|
||||
@ -117,7 +115,7 @@ module.exports = function(God) {
|
||||
* @method findByPort
|
||||
* @param {} port
|
||||
* @param {} cb
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
God.findByPort = function(port, cb) {
|
||||
var db = God.clusters_db;
|
||||
@ -136,7 +134,7 @@ module.exports = function(God) {
|
||||
* @method findByFullPath
|
||||
* @param {} path
|
||||
* @param {} cb
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
God.findByFullPath = function(path, cb) {
|
||||
var db = God.clusters_db;
|
||||
@ -155,7 +153,7 @@ module.exports = function(God) {
|
||||
* Return TRUE if process online
|
||||
* @method checkProcess
|
||||
* @param {} pid
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
God.checkProcess = function(pid) {
|
||||
if (!pid) return false;
|
||||
@ -233,7 +231,7 @@ module.exports = function(God) {
|
||||
* to monitor unstable starts
|
||||
* @method resetState
|
||||
* @param {} pm2_env
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
God.resetState = function(pm2_env) {
|
||||
pm2_env.created_at = Date.now();
|
||||
@ -244,7 +242,7 @@ module.exports = function(God) {
|
||||
* Description
|
||||
* @method deepReset
|
||||
* @param {} pm2_env
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
God.deepReset = function(pm2_env) {
|
||||
pm2_env.created_at = Date.now();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user