Skip to content

Commit

Permalink
🐛 fix health check error not catched
Browse files Browse the repository at this point in the history
  • Loading branch information
yanyongyu authored Dec 4, 2023
1 parent e6acb91 commit b7bbd64
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plugins/health_check/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@Author : yanyongyu
@Date : 2022-10-10 06:57:31
@LastEditors : yanyongyu
@LastEditTime : 2023-12-02 14:54:09
@LastEditTime : 2023-12-04 16:42:20
@Description : Health check plugin
@GitHub : https://github.com/yanyongyu
"""
Expand Down Expand Up @@ -45,7 +45,8 @@ async def health_check():

# check playwright connection
try:
assert get_browser().is_connected()
if not get_browser().is_connected():
raise RuntimeError("Playwright browser is not connected.")
except Exception as e:
logger.opt(exception=e).error("Playwright connection health check failed.")
return JSONResponse(
Expand Down

0 comments on commit b7bbd64

Please sign in to comment.