提交 30962199 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

fix logout bug

上级 bf809744
......@@ -33,6 +33,10 @@ export class Profile {
}
}
public toString() {
return `Profile<${this.name}>`
}
public load(): void {
log.verbose('Profile', 'load() file: %s', this.file)
this.obj = {}
......
......@@ -84,7 +84,7 @@ export class PuppetWeb extends Puppet {
public toString() { return `PuppetWeb<${this.options.profile.name}>` }
public async init(): Promise<void> {
log.verbose('PuppetWeb', `init() with profile:${this.options.profile.name}`)
log.verbose('PuppetWeb', `init() with ${this.options.profile}`)
this.state.target('live')
this.state.current('live', false)
......@@ -238,7 +238,7 @@ export class PuppetWeb extends Puppet {
}
}
log.verbose('PuppetWeb', 'quit() stop watchdog before do quit')
log.verbose('PuppetWeb', 'quit() make watchdog sleep before do quit')
this.puppetWatchdog.sleep()
this.state.target('dead')
......@@ -247,6 +247,7 @@ export class PuppetWeb extends Puppet {
try {
if (this.bridge) {
await this.bridge.quit()
setImmediate(() => this.bridge.removeAllListeners())
} else {
log.warn('PuppetWeb', 'quit() no bridge!')
}
......
......@@ -482,6 +482,7 @@ export class Wechaty extends EventEmitter implements Sayable {
try {
await puppetBeforeDie.quit()
setImmediate(() => puppetBeforeDie.removeAllListeners())
} catch (e) {
log.error('Wechaty', 'stop() exception: %s', e.message)
Raven.captureException(e)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册