Compare commits

...

12 Commits

Author SHA1 Message Date
Ali Razmjoo
3ccec60047
Merge 4e667c9adb into 46d90a6a99 2024-09-29 15:06:26 +00:00
Louis Lam
46d90a6a99
1.23.14 changes merge to 2.0.0 (#5138) 2024-09-29 23:06:09 +08:00
Louis Lam
3479992302 Resolve conflict of package-lock.json 2024-09-29 22:13:05 +08:00
Louis Lam
030bb1c0b8 Merge branch 'master' into 1.23.14-to-2.0.0
# Conflicts:
#	package-lock.json
2024-09-29 22:12:25 +08:00
Louis Lam
7da401662f Merge branch '1.23.X' into 1.23.14-to-2.0.0
# Conflicts:
#	package-lock.json
#	package.json
2024-09-29 22:05:23 +08:00
Louis Lam
243726b03c Update to 1.23.14 2024-09-29 21:46:19 +08:00
Louis Lam
936665aac3
[1.23.X] Update dependencies (#5132) 2024-09-28 03:43:54 +08:00
Ali Razmjoo
4e667c9adb
close the current page context 2024-06-11 13:20:00 +02:00
Ali Razmjoo
617634f2af
Update real-browser-monitor-type.js 2024-06-10 16:45:56 +02:00
Ali Razmjoo
124f5a471a
Merge branch 'louislam:master' into fix-browser-high-cpu-issue 2024-06-10 16:31:50 +02:00
Ali Razmjoo
a87b833a5a
Merge branch 'master' into fix-browser-high-cpu-issue 2023-09-23 13:17:51 +02:00
Ali Razmjoo
caa8dd8ec2 close the browser after getBrowser() 2023-09-23 13:11:02 +02:00
3 changed files with 3117 additions and 2330 deletions

5419
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@
"build-docker-nightly-local": "npm run build && docker build -f docker/dockerfile -t louislam/uptime-kuma:nightly2 --target nightly .", "build-docker-nightly-local": "npm run build && docker build -f docker/dockerfile -t louislam/uptime-kuma:nightly2 --target nightly .",
"build-docker-pr-test": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64 -t louislam/uptime-kuma:pr-test2 --target pr-test2 . --push", "build-docker-pr-test": "docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64 -t louislam/uptime-kuma:pr-test2 --target pr-test2 . --push",
"upload-artifacts": "docker buildx build -f docker/dockerfile --platform linux/amd64 -t louislam/uptime-kuma:upload-artifact --build-arg VERSION --build-arg GITHUB_TOKEN --target upload-artifact . --progress plain", "upload-artifacts": "docker buildx build -f docker/dockerfile --platform linux/amd64 -t louislam/uptime-kuma:upload-artifact --build-arg VERSION --build-arg GITHUB_TOKEN --target upload-artifact . --progress plain",
"setup": "git checkout 1.23.13 && npm ci --production && npm run download-dist", "setup": "git checkout 1.23.14 && npm ci --production && npm run download-dist",
"download-dist": "node extra/download-dist.js", "download-dist": "node extra/download-dist.js",
"mark-as-nightly": "node extra/mark-as-nightly.js", "mark-as-nightly": "node extra/mark-as-nightly.js",
"reset-password": "node extra/reset-password.js", "reset-password": "node extra/reset-password.js",
@ -72,7 +72,7 @@
"start-server-node14-win": "private\\node14\\node.exe server/server.js" "start-server-node14-win": "private\\node14\\node.exe server/server.js"
}, },
"dependencies": { "dependencies": {
"@grpc/grpc-js": "~1.7.3", "@grpc/grpc-js": "~1.8.22",
"@louislam/ping": "~0.4.4-mod.1", "@louislam/ping": "~0.4.4-mod.1",
"@louislam/sqlite3": "15.1.6", "@louislam/sqlite3": "15.1.6",
"@vvo/tzdb": "^6.125.0", "@vvo/tzdb": "^6.125.0",
@ -91,7 +91,7 @@
"dayjs": "~1.11.5", "dayjs": "~1.11.5",
"dev-null": "^0.1.1", "dev-null": "^0.1.1",
"dotenv": "~16.0.3", "dotenv": "~16.0.3",
"express": "~4.19.2", "express": "~4.21.0",
"express-basic-auth": "~1.2.1", "express-basic-auth": "~1.2.1",
"express-static-gzip": "~2.1.7", "express-static-gzip": "~2.1.7",
"feed": "^4.2.2", "feed": "^4.2.2",
@ -138,8 +138,8 @@
"redbean-node": "~0.3.0", "redbean-node": "~0.3.0",
"redis": "~4.5.1", "redis": "~4.5.1",
"semver": "~7.5.4", "semver": "~7.5.4",
"socket.io": "~4.7.5", "socket.io": "~4.8.0",
"socket.io-client": "~4.7.5", "socket.io-client": "~4.8.0",
"socks-proxy-agent": "6.1.1", "socks-proxy-agent": "6.1.1",
"tar": "~6.2.1", "tar": "~6.2.1",
"tcp-ping": "~0.1.1", "tcp-ping": "~0.1.1",
@ -172,7 +172,7 @@
"cross-env": "~7.0.3", "cross-env": "~7.0.3",
"delay": "^5.0.0", "delay": "^5.0.0",
"dns2": "~2.0.1", "dns2": "~2.0.1",
"dompurify": "~3.0.11", "dompurify": "~3.1.7",
"eslint": "~8.14.0", "eslint": "~8.14.0",
"eslint-plugin-jsdoc": "~46.4.6", "eslint-plugin-jsdoc": "~46.4.6",
"eslint-plugin-vue": "~8.7.1", "eslint-plugin-vue": "~8.7.1",

View File

@ -229,6 +229,20 @@ async function testRemoteBrowser(remoteBrowserURL) {
throw new Error(e.message); throw new Error(e.message);
} }
} }
/**
* Cleanup function to terminate all browser processes and clear cache after each monitoring check.
* @param {import ("playwright-core").Page} page The page to close
* @returns {Promise<void>}
*/
async function cleanupBrowser(page) {
if (page) {
await page.context().clearCookies();
await page.context().clearPermissions();
await page.close();
}
}
class RealBrowserMonitorType extends MonitorType { class RealBrowserMonitorType extends MonitorType {
name = "real-browser"; name = "real-browser";
@ -252,7 +266,7 @@ class RealBrowserMonitorType extends MonitorType {
path: path.join(Database.screenshotDir, filename), path: path.join(Database.screenshotDir, filename),
}); });
await context.close(); await cleanupBrowser(page); // Ensure cleanup is called after each monitoring check
if (res.status() >= 200 && res.status() < 400) { if (res.status() >= 200 && res.status() < 400) {
heartbeat.status = UP; heartbeat.status = UP;