mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
unify unique id
This commit is contained in:
parent
0f693c69ed
commit
0d92abb61f
@ -23,7 +23,7 @@ function generateId() {
|
||||
var crypto = require('crypto');
|
||||
var os = require('os');
|
||||
|
||||
var parts = [os.hostname(), process.pid, +(new Date)];
|
||||
var parts = [os.hostname(), JSON.stringify(os.networkInterfaces)];
|
||||
var hash = crypto.createHash('md5').update(parts.join(''));
|
||||
return hash.digest('hex');
|
||||
}
|
||||
|
||||
@ -4,6 +4,10 @@ var WatchDog = require('../lib/WatchDog.js');
|
||||
var fs = require('fs');
|
||||
var cst = require('../constants.js');
|
||||
|
||||
if (fs.existsSync(cst.WATCHDOG_FILE)) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
(function pre_init() {
|
||||
fs.exists(cst.DEFAULT_FILE_PATH, function(exist) {
|
||||
if (!exist) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user