Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Pangea-Agent
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gavin-Group
Pangea-Agent
Commits
f1c0112e
Commit
f1c0112e
authored
Dec 30, 2025
by
youxiaoji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* [playwright 初始化后不再初始化]
parent
488dd115
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
19 deletions
+22
-19
PlaywrightManagerImpl.java
...pangea/hiagent/tool/playwright/PlaywrightManagerImpl.java
+22
-19
No files found.
backend/src/main/java/pangea/hiagent/tool/playwright/PlaywrightManagerImpl.java
View file @
f1c0112e
...
@@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
jakarta.annotation.PreDestroy
;
import
jakarta.annotation.PreDestroy
;
import
java.util.concurrent.*
;
import
java.util.concurrent.*
;
/**
/**
...
@@ -54,8 +55,10 @@ public class PlaywrightManagerImpl implements PlaywrightManager {
...
@@ -54,8 +55,10 @@ public class PlaywrightManagerImpl implements PlaywrightManager {
log
.
info
(
"正在初始化Playwright管理器..."
);
log
.
info
(
"正在初始化Playwright管理器..."
);
// 创建Playwright实例
// 创建Playwright实例
if
(
playwright
==
null
)
{
this
.
playwright
=
Playwright
.
create
();
this
.
playwright
=
Playwright
.
create
();
}
if
(
browser
==
null
)
{
// 启动Chrome浏览器,无头模式
// 启动Chrome浏览器,无头模式
this
.
browser
=
playwright
.
chromium
().
launch
(
new
BrowserType
.
LaunchOptions
()
this
.
browser
=
playwright
.
chromium
().
launch
(
new
BrowserType
.
LaunchOptions
()
.
setHeadless
(
true
)
.
setHeadless
(
true
)
...
@@ -77,7 +80,7 @@ public class PlaywrightManagerImpl implements PlaywrightManager {
...
@@ -77,7 +80,7 @@ public class PlaywrightManagerImpl implements PlaywrightManager {
"--disable-gpu"
,
"--disable-gpu"
,
"--remote-allow-origins=*"
)));
"--remote-allow-origins=*"
)));
});
});
}
// 每5分钟检查一次超时的用户上下文
// 每5分钟检查一次超时的用户上下文
cleanupScheduler
.
scheduleAtFixedRate
(
this
::
cleanupExpiredContexts
,
cleanupScheduler
.
scheduleAtFixedRate
(
this
::
cleanupExpiredContexts
,
5
,
3600
,
TimeUnit
.
MINUTES
);
5
,
3600
,
TimeUnit
.
MINUTES
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment