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
alpha
physical
Commits
4db1d038
Commit
4db1d038
authored
Apr 10, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify bug
parent
9750966e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
es.py
libs/es.py
+1
-1
pictorial.py
trans2es/models/pictorial.py
+12
-5
type_info.py
trans2es/type_info.py
+1
-2
No files found.
libs/es.py
View file @
4db1d038
...
...
@@ -155,7 +155,7 @@ class ESPerform(object):
bulk_actions
=
[]
if
sub_index_name
==
"topic"
:
if
sub_index_name
==
"topic"
or
sub_index_name
==
"topic-star-routing"
:
for
data
in
data_list
:
if
data
:
bulk_actions
.
append
({
...
...
trans2es/models/pictorial.py
View file @
4db1d038
...
...
@@ -75,12 +75,19 @@ class Pictorial(models.Model):
def
get_effective
(
self
,
topic_id_list
):
try
:
topic_id_list
=
Topic
.
objects
.
filter
(
id__in
=
topic_id_list
,
content_level__in
=
[
3
,
4
,
5
,
0
],
is_online
=
True
)
.
count
()
if
topic_id_list
>=
5
:
return
True
else
:
return
False
effective_num
=
0
ret
=
False
for
topic_id
in
topic_id_list
:
topic_id_object
=
Topic
.
objects
.
filter
(
id
=
topic_id
)
.
first
()
if
topic_id_object
and
topic_id_object
.
is_online
and
topic_id_object
.
content_level
in
(
0
,
3
,
4
,
5
):
effective_num
+=
1
if
effective_num
>=
5
:
ret
=
True
break
return
ret
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
False
...
...
trans2es/type_info.py
View file @
4db1d038
...
...
@@ -143,8 +143,6 @@ class TypeInfo(object):
))
else
:
if
data
:
data_list
.
append
(
data
)
if
self
.
type
==
"topic"
:
ori_topic_star
=
redis_client
.
hget
(
self
.
physical_topic_star
,
data
[
"id"
])
if
not
ori_topic_star
:
...
...
@@ -159,6 +157,7 @@ class TypeInfo(object):
data_list
.
append
(
old_data
)
redis_client
.
hset
(
self
.
physical_topic_star
,
data
[
"id"
],
data
[
"content_level"
])
data_list
.
append
(
data
)
# if self.type=="topic" and instance.content_level and int(instance.content_level)>=4:
# topic_data_high_star_list.append(data)
...
...
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