Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
V
vest
Project
Project
Details
Activity
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
rank
vest
Commits
958c2a88
Commit
958c2a88
authored
Jan 03, 2020
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
e0c66b0d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
consum.py
moment/views/consum.py
+3
-0
No files found.
moment/views/consum.py
View file @
958c2a88
...
@@ -41,7 +41,10 @@ def kafka_consum(topic_name=None):
...
@@ -41,7 +41,10 @@ def kafka_consum(topic_name=None):
card_info
=
json
.
loads
(
str
(
msg
.
value
,
encoding
=
"utf8"
))
card_info
=
json
.
loads
(
str
(
msg
.
value
,
encoding
=
"utf8"
))
if
card_info
[
'card_type'
]
==
"auto_vest"
:
if
card_info
[
'card_type'
]
==
"auto_vest"
:
###在这里去判断一下当前的partition和offset是否已经消费过了 如果已经消费了需要直接去掉数据
###在这里去判断一下当前的partition和offset是否已经消费过了 如果已经消费了需要直接去掉数据
logging
.
info
(
"11111判断是否消费过的函数消费处理耗时:
%
f"
%
(
card_info
[
"card_id"
],
time
.
time
()
-
begin
))
bol_consum
=
judge_offset_partition_have_consum
(
offset
=
msg
.
offset
,
partition
=
msg
.
partition
)
bol_consum
=
judge_offset_partition_have_consum
(
offset
=
msg
.
offset
,
partition
=
msg
.
partition
)
logging
.
info
(
"22222判断是否消费过的函数消费处理耗时:
%
f"
%
(
card_info
[
"card_id"
],
time
.
time
()
-
begin
))
if
bol_consum
:
if
bol_consum
:
logging
.
info
(
"消费到新数据了[
%
s,
%
s,
%
s,
%
s],get card_info:
%
s"
%
(
logging
.
info
(
"消费到新数据了[
%
s,
%
s,
%
s,
%
s],get card_info:
%
s"
%
(
str
(
msg
.
topic
),
str
(
msg
.
partition
),
str
(
msg
.
offset
),
str
(
msg
.
key
),
card_info
))
str
(
msg
.
topic
),
str
(
msg
.
partition
),
str
(
msg
.
offset
),
str
(
msg
.
key
),
card_info
))
...
...
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