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
09037ed3
Commit
09037ed3
authored
Jul 05, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改tasks
parent
0e5287e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
tasks.py
injection/data_sync/tasks.py
+6
-10
No files found.
injection/data_sync/tasks.py
View file @
09037ed3
# -*- coding: UTF-8 -*-
import
logging
import
traceback
import
json
import
pymysql
import
threading
import
random
import
datetime
from
celery
import
shared_task
from
django.conf
import
settings
from
django.core
import
serializers
from
associate.type_info
import
get_type_info_map
as
get_type_info_associate
from
trans2es.type_info
import
get_type_info_map
# from rpc.all import get_rpc_remote_invoker
from
libs.es
import
ESPerform
from
libs.cache
import
redis_client
@shared_task
...
...
@@ -21,7 +13,9 @@ def write_to_es(es_type, pk_list, use_batch_query_set=False):
logging
.
info
(
"consume es_type:
%
s"
%
str
(
es_type
))
try
:
if
es_type
==
"suggest_v1"
or
es_type
==
"suggest"
:
suggest_index_type
=
[
"doctor_tips"
,
"hospital_tips"
,
"itemwiki_tips"
,
"collectwiki_tips"
,
'brandwiki_tips'
,
"productwiki_tips"
,
'tag_tips'
,
'wordrel_tips'
]
if
es_type
in
suggest_index_type
:
pk_list
=
list
(
frozenset
(
pk_list
))
type_info_map
=
get_type_info_map
()
type_info
=
type_info_map
[
es_type
]
...
...
@@ -46,3 +40,5 @@ def write_to_es(es_type, pk_list, use_batch_query_set=False):
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
finally
:
return
es_type
,
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