feat: del browser instace from pool

This commit is contained in:
karishmas6
2024-06-01 10:27:51 +05:30
parent 026577bf88
commit aa9b5d1c43

View File

@@ -56,4 +56,19 @@ export class BrowserPool {
}
logger.log('debug', `Remote browser with id: ${id} added to the pool`);
};
/**
* Removes the remote browser instance from the pool.
* @param id remote browser instance's id
* @returns true if the browser was removed successfully, false otherwise
*/
public deleteRemoteBrowser = (id: string) : boolean => {
if (!this.pool[id]) {
logger.log('warn', `Remote browser with id: ${id} does not exist in the pool`);
return false;
}
delete(this.pool[id]);
logger.log('debug', `Remote browser with id: ${id} deleted from the pool`);
return true;
};
}