bottleneck
bottleneck copied to clipboard
TypeError: _this.task is not a function
Using a scheduler inside a loop:
The thing that I'm scheduling is definitely a function, returns a promise. Adding Promise.resolve() doesn't help. Reading the gotchas, if I put the loop inside the scheduler then the nothing gets throttled and the remote API is overwhelmed and throws errors.
Error on the code shown:
/Users/wdecorte/GitHub/twentyonezero-embeddings/node_modules/bottleneck/lib/Job.js:141 passed = yield chained != null ? chained.schedule(_this.options, _this.task, ..._this.args) : _this.task(..._this.args); ^
TypeError: _this.task is not a function
at /Users/wdecorte/GitHub/twentyonezero-embeddings/node_modules/bottleneck/lib/Job.js:141:109
at Generator.next (