Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-kafkaconsumer-gpsbs
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4f327fa9
authored
Dec 27, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
更新保存数据逻辑 60秒保存一次数据
1 parent
d0728f1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
src/main/java/cn/com/glsx/kafka/service/TransitHandleService.java
src/main/java/cn/com/glsx/kafka/service/TransitHandleService.java
View file @
4f327fa
...
@@ -39,7 +39,7 @@ public class TransitHandleService {
...
@@ -39,7 +39,7 @@ public class TransitHandleService {
/**
/**
* 间隔时间
* 间隔时间
*/
*/
private
static
final
int
STEP
=
3
000
;
private
static
final
int
STEP
=
60
000
;
/**
/**
...
@@ -78,7 +78,7 @@ public class TransitHandleService {
...
@@ -78,7 +78,7 @@ public class TransitHandleService {
}
}
// 当数据大小为500个 或者 时间间隔3秒 的时候 保存一次
// 当数据大小为500个 或者 时间间隔3秒 的时候 保存一次
if
(
deviceLocationMap
.
size
()
>=
500
||
System
.
currentTimeMillis
()
>=
tempTime
+
STEP
)
{
if
(
System
.
currentTimeMillis
()
>=
tempTime
+
STEP
)
{
log
.
info
(
"开始插入或者更新Gps和基站的数据大小==="
+
deviceLocationMap
.
size
());
log
.
info
(
"开始插入或者更新Gps和基站的数据大小==="
+
deviceLocationMap
.
size
());
remoteDeviceLocationService
.
saveOrUpdateDeviceLocationData
(
deviceLocationMap
.
values
());
remoteDeviceLocationService
.
saveOrUpdateDeviceLocationData
(
deviceLocationMap
.
values
());
// 清空缓存map
// 清空缓存map
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment