Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
search_tips
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
rank
search_tips
Commits
0e5287e9
Commit
0e5287e9
authored
Jul 04, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
be937165
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
tasks.py
injection/data_sync/tasks.py
+9
-12
No files found.
injection/data_sync/tasks.py
View file @
0e5287e9
...
...
@@ -18,7 +18,6 @@ from libs.cache import redis_client
@shared_task
def
write_to_es
(
es_type
,
pk_list
,
use_batch_query_set
=
False
):
logging
.
info
(
"get -----------------"
)
logging
.
info
(
"consume es_type:
%
s"
%
str
(
es_type
))
try
:
...
...
@@ -33,19 +32,17 @@ def write_to_es(es_type, pk_list, use_batch_query_set=False):
use_batch_query_set
=
use_batch_query_set
,
es
=
ESPerform
.
get_cli
()
)
else
:
if
es_type
==
"suggest_v1"
or
es_type
==
"suggest"
:
pk_list
=
list
(
frozenset
(
pk_list
))
type_info_map
=
get_type_info_associate
()
type_info
=
type_info_map
[
es_type
]
pk_list
=
list
(
frozenset
(
pk_list
))
type_info_map
=
get_type_info_associate
()
type_info
=
type_info_map
[
es_type
]
type_info
.
insert_table_by_pk_list
(
sub_index_name
=
type_info
.
name
,
pk_list
=
pk_list
,
use_batch_query_set
=
use_batch_query_set
,
es
=
ESPerform
.
get_cli
()
)
type_info
.
insert_table_by_pk_list
(
sub_index_name
=
type_info
.
name
,
pk_list
=
pk_list
,
use_batch_query_set
=
use_batch_query_set
,
es
=
ESPerform
.
get_cli
()
)
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
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