Skip to content

Commit

Permalink
fix: Remove unnecessary code for close instance (close #1835)
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Dec 24, 2023
1 parent 4912734 commit 43f2a9b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/api/whatsapp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,18 @@ export class Whatsapp extends BusinessLayer {

if (!this.page.isClosed()) {
await this.page.close().catch(() => null);
}

await browser.close().catch(() => null);

try {
const process = browser.process();
if (process) {
treekill(process.pid, 'SIGKILL');
}
} catch (error) {}
await browser.close().catch(() => null);
/*
Code removed as it is not necessary.
try {
const process = browser.process();
if (process) {
treekill(process.pid, 'SIGKILL');
}
} catch (error) {}
*/
}

return true;
}
Expand Down

0 comments on commit 43f2a9b

Please sign in to comment.