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 1453f4e6
authored
Dec 21, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
减少gps基站保存时间间隔
1 parent
56bd873a
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 @
1453f4e
...
...
@@ -39,7 +39,7 @@ public class TransitHandleService {
/**
* 间隔时间
*/
private
static
final
int
STEP
=
5
000
;
private
static
final
int
STEP
=
3
000
;
/**
...
...
@@ -72,7 +72,7 @@ public class TransitHandleService {
redisUtils
.
set
(
setKey
(
deviceLocationDto
.
getSn
()),
deviceLocationCache
);
deviceLocationMap
.
put
(
deviceLocationDto
.
getSn
(),
deviceLocationCache
);
// 当数据大小为
2
00个的时候 保存一次
// 当数据大小为
1
00个的时候 保存一次
if
(
deviceLocationMap
.
size
()
==
100
||
System
.
currentTimeMillis
()
>=
tempTime
+
STEP
)
{
log
.
info
(
"开始插入或者更新Gps和基站的数据大小==="
+
deviceLocationMap
.
size
());
remoteDeviceLocationService
.
saveOrUpdateDeviceLocationData
(
deviceLocationMap
.
values
());
...
...
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