diff --git a/core/application.mjs b/core/application.mjs index 83e6ef5..3f9957c 100644 --- a/core/application.mjs +++ b/core/application.mjs @@ -26,7 +26,8 @@ export default class Application extends EventEmitter { getLog: getLog, HttpServer: HttpServer, request: request, - } + }, + version: '', } this.config = defaults({}, this.ctx.db.config[name]) this.provider = provider @@ -34,7 +35,6 @@ export default class Application extends EventEmitter { this.updating = false this.http = new HttpServer(this.config) this.module = null - this.running = '' this.workers = {} // Fresh is used to indicate that when we run the application and it fails, @@ -390,14 +390,14 @@ export default class Application extends EventEmitter { runVersion(version) { this.ctx.db.data.core[this.name].active = version - this.running = version - this.emit('running', this.running) + this.ctx.version = version + this.emit('running', this.ctx.version) return this.ctx.db.write().then(() => { return this._runVersion(version) .catch((err) => { - this.running = '' - this.emit('running', this.running) + this.ctx.version = '' + this.emit('running', this.ctx.version) return Promise.reject(err) }) }) @@ -477,8 +477,8 @@ export default class Application extends EventEmitter { } closeServer() { - this.running = '' - this.emit('running', this.running) + this.ctx.version = '' + this.emit('running', this.ctx.version) if (this.config.cluster && !this.isSlave) { if (this.__clusterWorkerDied) { this.cluster.off('exit', this.__clusterWorkerDied)