Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform
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
0
Merge Requests
0
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
周健威
rs-cloud-platform
Commits
81515cc0
Commit
81515cc0
authored
Nov 29, 2023
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
1cf26db9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
GtDataRestClient.java
.../java/com/upyuns/platform/rs/gtdata/GtDataRestClient.java
+24
-24
No files found.
ace-common/src/main/java/com/upyuns/platform/rs/gtdata/GtDataRestClient.java
View file @
81515cc0
...
@@ -106,30 +106,30 @@ public class GtDataRestClient {
...
@@ -106,30 +106,30 @@ public class GtDataRestClient {
@PostConstruct
@PostConstruct
public
void
init
()
{
public
void
init
()
{
//
try {
try
{
//
login();// 第一次更新认证信息,在初始化时执行
login
();
// 第一次更新认证信息,在初始化时执行
//
} catch (GtDataRestException e) {
}
catch
(
GtDataRestException
e
)
{
//
logger.warn("GtData login error. try again...", e);
logger
.
warn
(
"GtData login error. try again..."
,
e
);
//
logout(defaultToken);
logout
(
defaultToken
);
//
login(); // 异常时,再试一次更新认证信息
login
();
// 异常时,再试一次更新认证信息
//
}
}
//
int cpuCoreNumber = Runtime.getRuntime().availableProcessors();// cpu内核数
int
cpuCoreNumber
=
Runtime
.
getRuntime
().
availableProcessors
();
// cpu内核数
//
scheduler = Executors.newScheduledThreadPool(cpuCoreNumber);
scheduler
=
Executors
.
newScheduledThreadPool
(
cpuCoreNumber
);
//
Runnable task = new Runnable() {
Runnable
task
=
new
Runnable
()
{
//
@Override
@Override
//
public void run() {
public
void
run
()
{
//
try {
try
{
//
updateAuth(); // 更新认证信息
updateAuth
();
// 更新认证信息
//
} catch (GtDataRestException e) {
}
catch
(
GtDataRestException
e
)
{
//
logger.warn("GtData getSign error. try relogin...", e);
logger
.
warn
(
"GtData getSign error. try relogin..."
,
e
);
//
logout(defaultToken);
logout
(
defaultToken
);
//
login(); // 异常时,重新登陆
login
();
// 异常时,重新登陆
//
}
}
//
}
}
//
};
};
//
Thread thread = new Thread(task);
Thread
thread
=
new
Thread
(
task
);
//
thread.setDaemon(true);
thread
.
setDaemon
(
true
);
//
scheduler.scheduleAtFixedRate(thread, 5L, 5L, TimeUnit.MINUTES);// 每5分钟执行一次
scheduler
.
scheduleAtFixedRate
(
thread
,
5L
,
5L
,
TimeUnit
.
MINUTES
);
// 每5分钟执行一次
}
}
...
...
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