Skip to content

Commit

Permalink
adding temp static profile folder so infinite aren't created
Browse files Browse the repository at this point in the history
  • Loading branch information
Bombg committed Oct 18, 2024
1 parent 5a8c5ce commit 24c5a6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions utils/NoDriverBrowserCreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,15 @@ async def GetBrowser(proxy=""):
browser = await uc.start(sandbox=toSandbox,
headless=toHeadless,
browser_args=[f'--proxy-server={proxy}','--mute-audio','--disable-3d-apis','--disable-dev-shm-usage','--disable-gpu','--disable-blink-features=AutomationControlled'],
retries = Constants.NODRIVER_BROWSER_CONNECT_RETRIES)
retries = Constants.NODRIVER_BROWSER_CONNECT_RETRIES,
user_data_dir="/ndTemp"
)
else:
browser = await uc.start(sandbox=toSandbox,
headless=toHeadless,
retries = Constants.NODRIVER_BROWSER_CONNECT_RETRIES)
retries = Constants.NODRIVER_BROWSER_CONNECT_RETRIES,
user_data_dir="/ndTemp"
)
except Exception as e:
logger.warning(f"error creating browser in GetBrowser: {e}")
await asyncio.sleep(1 * Constants.NODRIVER_WAIT_MULTIPLIER)
Expand Down
2 changes: 1 addition & 1 deletion utils/StaticMethods.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ def rebootServer() -> None:
os.system('reboot')

def safeRebootServer() -> None:
time.sleep(300)
logger.warning("Scheduled restart is happening.\nSleeping for 300 seconds before restart, in case something goes horribly wrong")
time.sleep(300)
rebootServer()

def GetThumbnail(tempThumbUrl, constantsThumbnail):
Expand Down

0 comments on commit 24c5a6c

Please sign in to comment.