@brown-ds/distribution 0.0.39 → 0.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6,5 +6,5 @@ Do NOT edit this file directly. Use it as a black box.
|
|
|
6
6
|
|
|
7
7
|
If you notice any issues with using this file, please contact the TAs.
|
|
8
8
|
*/
|
|
9
|
-
const id=require('../util/id'),log=require('../util/lo'+'g'),status={};global['moreStatus']={'sid':id['getSID'](global['nodeConfig']),'nid':id['getNID'](global['nodeConfig']),'counts':0x0},status['get']=function(
|
|
9
|
+
const id=require('../util/id'),log=require('../util/lo'+'g'),status={};global['moreStatus']={'sid':id['getSID'](global['nodeConfig']),'nid':id['getNID'](global['nodeConfig']),'counts':0x0},status['get']=function(_0x7619b7,_0x473632){_0x473632=_0x473632||function(){};if(_0x7619b7 in global['nodeConfig'])_0x473632(null,global['nodeConfig'][_0x7619b7]);else{if(_0x7619b7 in moreStatus)_0x473632(null,moreStatus[_0x7619b7]);else{if(_0x7619b7==='heapTotal')_0x473632(null,process['memoryUsag'+'e']()['heapTotal']);else _0x7619b7==='heapUsed'?_0x473632(null,process['memoryUsag'+'e']()['heapUsed']):_0x473632(new Error('Status\x20key'+'\x20not\x20found'));}}};const path=require('path'),{spawn}=require('child_proc'+'ess'),wire=require('../util/wi'+'re'),createSpawnedCb=function(_0x557908,_0x2e82f0){let _0x6ce769='\x0a\x20\x20\x20\x20let\x20o'+'nStart\x20=\x20'+_0x557908['toString']()+(';\x0a\x0a\x20\x20\x20\x20let'+'\x20callbackR'+'PC\x20=\x20')+wire['createRPC'](wire['toAsync'](_0x2e82f0))['toString']()+(';\x0a\x0a\x20\x20\x20\x20try'+'\x20{\x0a\x20\x20\x20\x20\x20\x20\x20'+'\x20onStart()'+';\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+'callbackRP'+'C(null,\x20gl'+'obal.nodeC'+'onfig,\x20()\x20'+'=>\x20{});\x0a\x20\x20'+'\x20\x20}\x0a\x20\x20\x20\x20ca'+'tch\x20(e)\x20{\x0a'+'\x20\x20\x20\x20\x20\x20\x20\x20ca'+'llbackRPC('+'e,\x20null,\x20('+')\x20=>\x20{});\x0a'+'\x20\x20\x20\x20}\x0a\x20\x20\x20\x20');return new Function(_0x6ce769);};status['spawn']=function(_0x572632,_0xb8c0e){const _0x189c6d=_0x572632;_0x189c6d['onStart']=_0x189c6d['onStart']||function(){};if(!_0x189c6d['port']||!_0x189c6d['ip']){_0xb8c0e(new Error('Port\x20and\x20I'+'P\x20are\x20requ'+'ired\x20in\x20th'+'e\x20configur'+'ation'));return;}log('[status.sp'+'awn]\x20Spawn'+'ing\x20node\x20w'+'ith\x20config'+'uration:\x20'+JSON['stringify'](_0x189c6d)),_0x189c6d['onStart']=createSpawnedCb(_0x189c6d['onStart'],_0xb8c0e);const _0x548ee3=path['join'](__dirname,'../../dist'+'ribution.j'+'s');let _0x24e7f3=spawn('node',[_0x548ee3,'--config',global['distributi'+'on']['util']['serialize'](_0x189c6d)],{'detached':!![],'stdio':'inherit'});_0x24e7f3;},status['stop']=function(_0x3569c7){_0x3569c7=_0x3569c7||function(){},_0x3569c7(null,global['nodeConfig']),log('[status.st'+'op]\x20Shutti'+'ng\x20down\x20no'+'de'),global['distributi'+'on']['node']['server']['close'](),process['exit'](-0xcb5*0x3+0x115f+0x14c0);},module['exports']=status;
|
|
10
10
|
/* eslint-enable */
|