Using worker id as lock
This commit is contained in:
+3
-3
@@ -15,9 +15,9 @@ Package.prototype.rootNS = function( name, path )
|
||||
|
||||
var _reload = function( e, filename )
|
||||
{
|
||||
if( this._lock )
|
||||
if( this._lock == global.X_SERVER_CLUSTER.worker.id )
|
||||
return;
|
||||
this._lock = true;
|
||||
this._lock = global.X_SERVER_CLUSTER.worker.id;
|
||||
|
||||
setTimeout( () =>
|
||||
{
|
||||
@@ -34,7 +34,7 @@ Package.prototype.load = function( _class )
|
||||
|
||||
var file = rootNS[ nsdomain ] + _class;
|
||||
|
||||
if( global.debug && global.X_SERVER_CLUSTER )
|
||||
if( global.debug && global.X_SERVER_CLUSTER && global.X_SERVER_CLUSTER.worker )
|
||||
{
|
||||
var src = require.resolve( file );
|
||||
if(!( src in require.cache ))
|
||||
|
||||
Reference in New Issue
Block a user