Skip to content

Commit aa6b1f7

Browse files
committed
wait for forceStop in strict mode
1 parent d2099d3 commit aa6b1f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/api/instagram.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,13 +557,13 @@ export class Instagram<PostType> {
557557
await this.addToPostBuffer(parsed);
558558
}
559559

560-
protected validatePost(post: PostType) {
560+
protected async validatePost(post: PostType) {
561561
const validationResult = this.validator.decode(post);
562562
if (this.strict) {
563563
try {
564564
ThrowReporter.report(validationResult);
565565
} catch (e) {
566-
this.forceStop();
566+
await this.forceStop();
567567
throw e;
568568
}
569569
return;
@@ -848,7 +848,7 @@ export class Instagram<PostType> {
848848
*/
849849
private async addToPostBuffer(post: PostType) {
850850
await this.postBufferLock.acquireAsync();
851-
this.validatePost(post);
851+
await this.validatePost(post);
852852
this.postBuffer.push(post);
853853
this.postBufferLock.release();
854854
}

0 commit comments

Comments
 (0)