mirror of
https://github.com/Doodle3D/Doodle3D-API
synced 2025-01-03 10:03:48 +01:00
added alive check in doodle3dapi
This commit is contained in:
parent
92fc33e2de
commit
65088708bd
@ -81,11 +81,15 @@ export default class extends EventDispatcher {
|
|||||||
|
|
||||||
async _update () {
|
async _update () {
|
||||||
while (this.autoUpdate) {
|
while (this.autoUpdate) {
|
||||||
try {
|
if (this.alive) {
|
||||||
this.state = await this.info.status();
|
try {
|
||||||
|
this.state = await this.info.status();
|
||||||
|
|
||||||
this.dispatchEvent({ type: 'update', state: this.state });
|
this.dispatchEvent({ type: 'update', state: this.state });
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
|
await this.checkAlive();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
await this.checkAlive();
|
await this.checkAlive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user