Sequence is not running on prototype
This commit is contained in:
parent
037eb0f352
commit
09431a6a05
|
@ -61,20 +61,23 @@ export class Sequence {
|
||||||
this.delay = typeof options.delay !== 'undefined' ? options.delay : 0
|
this.delay = typeof options.delay !== 'undefined' ? options.delay : 0
|
||||||
this.count = 0
|
this.count = 0
|
||||||
|
|
||||||
|
log.info({ id : this.id, started : true })
|
||||||
|
|
||||||
for (let i = 0; i < len; i++) {
|
for (let i = 0; i < len; i++) {
|
||||||
if (multiple > 1) {
|
if (multiple > 1) {
|
||||||
for (let x = 0; x < multiple; x++) {
|
for (let x = 0; x < multiple; x++) {
|
||||||
await this.intval.frame()
|
await this.intval.frame()
|
||||||
log.info({ id : this.id, count : this.count })
|
log.info('start', { id : this.id, count : this.count })
|
||||||
this.count++
|
this.count++
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await this.intval.frame()
|
await this.intval.frame()
|
||||||
log.info({ id : this.id, count : this.count })
|
log.info('start', { id : this.id, count : this.count })
|
||||||
this.count++
|
this.count++
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.delay > 0) {
|
|
||||||
|
if (this.delay > 0 && i < len - 1) {
|
||||||
await delay(this.delay)
|
await delay(this.delay)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,6 +96,8 @@ export class Sequence {
|
||||||
this.active = false
|
this.active = false
|
||||||
this.count = 0
|
this.count = 0
|
||||||
this.delay = 0
|
this.delay = 0
|
||||||
|
|
||||||
|
log.info('start', { id : this.id, stopped : true })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue