Skip to content

Commit

Permalink
Ignore sigterm to work in threads
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Jul 18, 2023
1 parent 2a9f635 commit 76d8424
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions agentbrowser/browser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
import re
import signal
from pyppeteer import launch
import os
import platform
Expand Down Expand Up @@ -66,7 +65,12 @@ async def async_init_browser(headless=True, executable_path=None):
executable_path = find_chrome()

if browser is None:
browser = await launch(headless=headless, executablePath=executable_path, autoClose=False)
browser = await launch(headless=headless, executablePath=executable_path, autoClose=False,
# set handleSIGINT to False to allow for graceful shutdown
handleSIGINT=False,
handleSIGTERM=False,
handleSIGHUP=False
)
return browser

# async version of create_page
Expand Down

0 comments on commit 76d8424

Please sign in to comment.