Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lesleyrs committed Jul 10, 2024
1 parent 15ac63e commit b025637
Show file tree
Hide file tree
Showing 3 changed files with 18,643 additions and 21,055 deletions.
7 changes: 1 addition & 6 deletions src/js/jagex2/io/ClientWorkerStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,7 @@ class WorkerReader {
private async readSlowByte(len: number): Promise<number> {
this.event = this.queue.removeHead() as WorkerEvent | null;
while (this.total < len) {
await Promise.race([
new Promise((resolve): ((value: PromiseLike<((data: WorkerEvent | null) => void) | null>) => void) => (this.callback = resolve)),
sleep(100000).then((): void => {
throw new Error('WorkerReader timed out or closed while reading.');
})
]);
await new Promise((resolve): ((value: PromiseLike<((data: WorkerEvent | null) => void) | null>) => void) => (this.callback = resolve));
}
return this.event ? this.event.read : this.readSlowByte(len);
}
Expand Down
Loading

0 comments on commit b025637

Please sign in to comment.