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
de271f43
Commit
de271f43
authored
Jan 20, 2020
by
李小芳
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'poll_num' into 'master'
commit See merge request
!41
parents
90adb9f8
4cc6dd8b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
consum.py
moment/views/consum.py
+2
-1
No files found.
moment/views/consum.py
View file @
de271f43
...
...
@@ -33,6 +33,8 @@ def kafka_consum(topic_name=None):
while
True
:
begin
=
time
.
time
()
msg_dict
=
consumser_obj
.
poll
(
timeout_ms
=
30000
,
max_records
=
100
)
consumser_obj
.
commit
()
for
msg_value
in
msg_dict
.
values
():
for
msg
in
msg_value
:
card_info
=
json
.
loads
(
str
(
msg
.
value
,
encoding
=
"utf8"
))
...
...
@@ -133,7 +135,6 @@ def kafka_consum(topic_name=None):
else
:
logging
.
info
(
"此条数据已经被paas了:
%
s"
%
card_info
[
'card_id'
])
logging
.
info
(
"消费处理耗时:
%
f"
%
(
time
.
time
()
-
begin
))
consumser_obj
.
commit
()
except
:
consumser_obj
.
close
()
logging_exception
()
...
...
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