molly-db 1.0.11 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- package/main.js +3 -3
- package/module/_worker_.js +2 -6
- package/package.json +1 -1
package/main.js
CHANGED
@@ -33,9 +33,9 @@ class molly_db{
|
|
33
33
|
}
|
34
34
|
);
|
35
35
|
|
36
|
-
this.worker.on('exit',(err)=>{ console.log(err); reject() });
|
37
|
-
this.worker.on('error',(err)=>{ console.log(err); reject() });
|
38
|
-
this.worker.on('message',(msg)=>{ console.log(msg); response() });
|
36
|
+
this.worker.on('exit',(err)=>{ console.log(err); reject(err) });
|
37
|
+
this.worker.on('error',(err)=>{ console.log(err); reject(err) });
|
38
|
+
this.worker.on('message',(msg)=>{ console.log(msg); response(msg) });
|
39
39
|
});
|
40
40
|
}
|
41
41
|
|
package/module/_worker_.js
CHANGED
@@ -32,14 +32,10 @@ function app(req,res){
|
|
32
32
|
(()=>{
|
33
33
|
try{
|
34
34
|
http.createServer( app ).listen( query.port,()=>{
|
35
|
-
console.log('molly-db cluster is running, please wait');
|
36
35
|
_init_().then(()=>{
|
37
36
|
worker.parentPort.postMessage({
|
38
|
-
protocol: 'HTTP',
|
39
|
-
|
40
|
-
workerID: process.pid,
|
41
|
-
msg: 'molly-db is running',
|
42
|
-
server: `http://localhost:${query.port}`,
|
37
|
+
protocol: 'HTTP', status: 'started',
|
38
|
+
workerID: process.pid, port: query.port,
|
43
39
|
});
|
44
40
|
}).catch(e=>{ process.exit(1); });
|
45
41
|
});
|