Comparing version 0.11.11 to 0.11.12
@@ -116,3 +116,10 @@ const | ||
await this._startup(this); | ||
// Handle exceptions in user code to maintain proper app state | ||
try{ | ||
await this._startup(this); | ||
} | ||
catch(err){ | ||
this.state = 'standby'; | ||
throw err; | ||
} | ||
@@ -136,17 +143,24 @@ if(this.conf.port) | ||
// Stop listening; Run shutdown handler; Wait actual http close | ||
if(this._server) | ||
var closedPromise = new Promise(done => this._server.close(done)); | ||
await this._shutdown(this); | ||
await closedPromise; | ||
var actualHTTPClose = new Promise(done => this._server.close(done)); | ||
delete this.global; | ||
// Handle exceptions in user code to maintain proper app state | ||
try{ | ||
await this._shutdown(this); | ||
} | ||
catch(err){ | ||
throw err; | ||
} | ||
finally{ | ||
await actualHTTPClose; | ||
delete this.global; | ||
this.log.info({ type: 'app' }, 'Stopped'); | ||
this.state = 'standby'; | ||
} | ||
this.log.info({ type: 'app' }, 'Stopped'); | ||
return this.state = 'standby'; | ||
return this.state; | ||
} | ||
call(fn, ...args){ | ||
return fn({ ...this.global, conf: this.conf, log: this.log }, ...args); | ||
return fn.call(this, { ...this.global, conf: this.conf, log: this.log }, ...args); | ||
} | ||
@@ -153,0 +167,0 @@ |
{ | ||
"name": "nodecaf", | ||
"version": "0.11.11", | ||
"version": "0.11.12", | ||
"description": "Nodecaf is a light framework for developing RESTful Apps in a quick and convenient manner.", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40969
625