Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bme-access-upload
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
李洪明
bme-access-upload
Commits
f3b775eb
Commit
f3b775eb
authored
Jul 08, 2025
by
李洪明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加登录
parent
02500678
Pipeline
#1277
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
HeartBeatJob.java
src/main/java/com/bme/access/upload/job/HeartBeatJob.java
+4
-3
No files found.
src/main/java/com/bme/access/upload/job/HeartBeatJob.java
View file @
f3b775eb
...
...
@@ -2,6 +2,7 @@ package com.bme.access.upload.job;
import
com.bme.access.upload.common.HttpUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
...
...
@@ -14,11 +15,11 @@ import org.springframework.stereotype.Component;
public
class
HeartBeatJob
{
private
final
static
String
HEART_BEAT_URL
=
"https://dctapi.soszyzg.com/dct/heartbeat"
;
@Scheduled
(
cron
=
"0 0/30 * * * ?"
)
@Scheduled
(
cron
=
"0 0/1 * * * ?"
)
public
void
heartBeat
()
{
try
{
HttpResponse
response
=
HttpUtils
.
sendGet
(
HEART_BEAT_URL
,
null
,
null
);
String
str
=
EntityUtils
.
toString
(
response
.
getEntity
());
HttpUtils
.
sendGet
(
HEART_BEAT_URL
,
null
,
null
);
}
catch
(
Exception
e
)
{
log
.
error
(
"心跳协议(每半个小时调用一次): {}"
,
e
);
}
...
...
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