0
0
mirror of https://github.com/Doodle3D/Doodle3D-API synced 2024-11-14 00:17:55 +01:00

added alive check in doodle3dapi

This commit is contained in:
casperlamboo 2016-04-21 15:17:10 +02:00
parent 92fc33e2de
commit 65088708bd

View File

@ -81,11 +81,15 @@ export default class extends EventDispatcher {
async _update () {
while (this.autoUpdate) {
try {
this.state = await this.info.status();
if (this.alive) {
try {
this.state = await this.info.status();
this.dispatchEvent({ type: 'update', state: this.state });
} catch(error) {
this.dispatchEvent({ type: 'update', state: this.state });
} catch(error) {
await this.checkAlive();
}
} else {
await this.checkAlive();
}