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
ba23b20b
Commit
ba23b20b
authored
Jan 14, 2020
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
del log
parent
6434219e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
8 deletions
+4
-8
click_fun.py
click/views/click_fun.py
+0
-1
comment_fun.py
comment/views/comment_fun.py
+0
-2
follow_fun.py
follow/views/follow_fun.py
+0
-1
consum.py
moment/views/consum.py
+4
-4
No files found.
click/views/click_fun.py
View file @
ba23b20b
...
@@ -53,7 +53,6 @@ def click(card_info):
...
@@ -53,7 +53,6 @@ def click(card_info):
status
=
rpc_invoker
[
'qa/irrigation/create_answer_vote'
](
user_id
=
card_info
[
'current_user_id'
],
status
=
rpc_invoker
[
'qa/irrigation/create_answer_vote'
](
user_id
=
card_info
[
'current_user_id'
],
answer_id
=
card_info
[
'card_id'
])
.
unwrap
()
answer_id
=
card_info
[
'card_id'
])
.
unwrap
()
logging
.
info
(
"get_card_info:
%
s,create_answer_vote:
%
s"
%
(
card_info
,
status
))
error
=
status
.
get
(
'error'
,
1
)
error
=
status
.
get
(
'error'
,
1
)
if
error
==
0
:
if
error
==
0
:
return
True
return
True
...
...
comment/views/comment_fun.py
View file @
ba23b20b
...
@@ -148,8 +148,6 @@ def comment(card_info):
...
@@ -148,8 +148,6 @@ def comment(card_info):
answer_id
=
card_info
[
'card_id'
],
answer_id
=
card_info
[
'card_id'
],
content
=
card_info
[
content
=
card_info
[
'comment_content'
])
.
unwrap
()
'comment_content'
])
.
unwrap
()
logging
.
info
(
"get_card_info:
%
s,create_answer_reply:
%
s"
%
(
card_info
,
status
))
error
=
status
.
get
(
'error'
,
1
)
error
=
status
.
get
(
'error'
,
1
)
if
error
==
0
:
if
error
==
0
:
return
True
return
True
...
...
follow/views/follow_fun.py
View file @
ba23b20b
...
@@ -52,7 +52,6 @@ def follow(card_info):
...
@@ -52,7 +52,6 @@ def follow(card_info):
status
=
rpc_invoker
[
'api/irrigation/user_add_follow'
](
follow_user_id
=
card_info
[
'current_user_id'
],
status
=
rpc_invoker
[
'api/irrigation/user_add_follow'
](
follow_user_id
=
card_info
[
'current_user_id'
],
followed_user_id
=
card_info
[
followed_user_id
=
card_info
[
'card_user_id'
])
.
unwrap
()
'card_user_id'
])
.
unwrap
()
logging
.
info
(
"get_card_info:
%
s,user_add_follow:
%
s"
%
(
card_info
,
status
))
error
=
status
.
get
(
'error'
,
1
)
error
=
status
.
get
(
'error'
,
1
)
if
error
==
0
:
if
error
==
0
:
...
...
moment/views/consum.py
View file @
ba23b20b
...
@@ -23,6 +23,7 @@ from moment.views.process_time import judge_offset_partition_have_consum, judge_
...
@@ -23,6 +23,7 @@ from moment.views.process_time import judge_offset_partition_have_consum, judge_
import
msgpack
import
msgpack
from
kafka
import
TopicPartition
from
kafka
import
TopicPartition
def
kafka_consum
(
topic_name
=
None
):
def
kafka_consum
(
topic_name
=
None
):
topic_name
=
settings
.
KAFKA_TOPIC_NAME
topic_name
=
settings
.
KAFKA_TOPIC_NAME
consumser_obj
=
KafkaConsumer
(
topic_name
,
bootstrap_servers
=
settings
.
KAFKA_BROKER_LIST
,
enable_auto_commit
=
True
,
consumser_obj
=
KafkaConsumer
(
topic_name
,
bootstrap_servers
=
settings
.
KAFKA_BROKER_LIST
,
enable_auto_commit
=
True
,
...
@@ -105,7 +106,7 @@ def kafka_consum(topic_name=None):
...
@@ -105,7 +106,7 @@ def kafka_consum(topic_name=None):
if
is_success
:
if
is_success
:
auto_comment_user
(
card_info
)
auto_comment_user
(
card_info
)
else
:
else
:
logging
.
info
(
"这条数据将被paas:
%
s"
%
card_info
)
pass
elif
action_type
==
"click"
:
# 在这里去调点赞的接口
elif
action_type
==
"click"
:
# 在这里去调点赞的接口
if
'have_click_number'
in
card_info
:
if
'have_click_number'
in
card_info
:
...
@@ -118,8 +119,7 @@ def kafka_consum(topic_name=None):
...
@@ -118,8 +119,7 @@ def kafka_consum(topic_name=None):
if
is_success
:
if
is_success
:
auto_click_user
(
card_info
)
auto_click_user
(
card_info
)
else
:
else
:
logging
.
info
(
"这条数据将被paas:
%
s"
%
card_info
)
pass
elif
action_type
==
"follow"
:
# 在这里去调关注的接口
elif
action_type
==
"follow"
:
# 在这里去调关注的接口
if
'have_follow_number'
in
card_info
:
if
'have_follow_number'
in
card_info
:
...
@@ -132,7 +132,7 @@ def kafka_consum(topic_name=None):
...
@@ -132,7 +132,7 @@ def kafka_consum(topic_name=None):
if
is_success
:
if
is_success
:
auto_follow_user
(
card_info
)
auto_follow_user
(
card_info
)
else
:
else
:
logging
.
info
(
"这条数据将被paas:
%
s"
%
card_info
)
pass
else
:
# push_time时间未到 需要等待
else
:
# push_time时间未到 需要等待
logging
.
info
(
"follow [
%
s,
%
s,
%
s,
%
s],push_time未到,需要等待"
%
(
logging
.
info
(
"follow [
%
s,
%
s,
%
s,
%
s],push_time未到,需要等待"
%
(
...
...
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