Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
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
0
Merge Requests
0
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
钟尚武
physical
Commits
91d43cc3
Commit
91d43cc3
authored
Apr 25, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
11c2887b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
21 deletions
+19
-21
tasks.py
injection/data_sync/tasks.py
+19
-21
No files found.
injection/data_sync/tasks.py
View file @
91d43cc3
...
...
@@ -25,27 +25,27 @@ exec_count = 0
@shared_task
def
write_to_es
(
es_type
,
pk_list
,
use_batch_query_set
=
False
):
try
:
#
pk_list = list(frozenset(pk_list))
#
#
if es_type == "register_user_tag":
#
RegisterUserTag.get_register_user_tag(pk_list)
#
elif es_type == "attention_user_tag":
#
RegisterUserTag.get_user_attention_tag(pk_list)
#
else:
#
type_info_map = get_type_info_map()
#
type_info = type_info_map[es_type]
#
#
logging.info("consume es_type:%s" % str(es_type))
#
type_info.insert_table_by_pk_list(
#
sub_index_name=es_type,
#
pk_list=pk_list,
#
use_batch_query_set=use_batch_query_set,
#
es=ESPerform.get_cli()
#
)
pk_list
=
list
(
frozenset
(
pk_list
))
if
es_type
==
"register_user_tag"
:
RegisterUserTag
.
get_register_user_tag
(
pk_list
)
elif
es_type
==
"attention_user_tag"
:
RegisterUserTag
.
get_user_attention_tag
(
pk_list
)
else
:
type_info_map
=
get_type_info_map
()
type_info
=
type_info_map
[
es_type
]
logging
.
info
(
"consume es_type:
%
s"
%
str
(
es_type
))
type_info
.
insert_table_by_pk_list
(
sub_index_name
=
es_type
,
pk_list
=
pk_list
,
use_batch_query_set
=
use_batch_query_set
,
es
=
ESPerform
.
get_cli
()
)
# if es_type == 'topic':
auto_click
(
pk_list
)
auto_reply
(
pk_list
)
auto_click
(
pk_list
)
auto_reply
(
pk_list
)
except
:
...
...
@@ -168,8 +168,6 @@ def auto_click(pk_list):
sleep_time
=
50
timer
=
threading
.
Timer
(
sleep_time
,
fun_timer
)
timer
.
start
()
sleep_time
=
random
.
randint
(
300
,
540
)
logging
.
info
(
"----------1-----------"
)
timer
=
threading
.
Timer
(
10
,
fun_timer
)
# 首次启动
...
...
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