mirror of
https://github.com/FlareSolverr/FlareSolverr.git
synced 2025-06-07 20:15:24 +00:00
Kill dead Chrome processes in Windows
This commit is contained in:
parent
8316350b98
commit
9b2c602a1f
@ -729,6 +729,15 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
|
|||||||
logger.debug("gracefully closed browser")
|
logger.debug("gracefully closed browser")
|
||||||
except Exception as e: # noqa
|
except Exception as e: # noqa
|
||||||
logger.debug(e, exc_info=True)
|
logger.debug(e, exc_info=True)
|
||||||
|
# Force kill Chrome process in Windows
|
||||||
|
# https://github.com/FlareSolverr/FlareSolverr/issues/772
|
||||||
|
if os.name == 'nt':
|
||||||
|
try:
|
||||||
|
subprocess.call(['taskkill', '/f', '/pid', str(self.browser_pid)],
|
||||||
|
stdout=subprocess.DEVNULL,
|
||||||
|
stderr=subprocess.DEVNULL)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
if (
|
if (
|
||||||
hasattr(self, "keep_user_data_dir")
|
hasattr(self, "keep_user_data_dir")
|
||||||
and hasattr(self, "user_data_dir")
|
and hasattr(self, "user_data_dir")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user