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
2d02af24
Commit
2d02af24
authored
Jun 24, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
0166dfc1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
common.py
search/utils/common.py
+10
-14
No files found.
search/utils/common.py
View file @
2d02af24
...
@@ -4,46 +4,42 @@
...
@@ -4,46 +4,42 @@
import
time
import
time
import
logging
import
logging
class
GroupSortTypes
(
object
):
class
GroupSortTypes
(
object
):
# 热度排序
# 热度排序
HOT_RECOMMEND
=
0
HOT_RECOMMEND
=
0
# 关注排序
# 关注排序
ATTENTION_RECOMMEND
=
1
ATTENTION_RECOMMEND
=
1
class
PickType
(
object
):
class
PickType
(
object
):
# 明星榜
# 明星榜
CELEBRITY_PICK
=
0
CELEBRITY_PICK
=
0
# 帖子榜
# 帖子榜
TOPIC_PICK
=
1
TOPIC_PICK
=
1
class
TopicDocumentField
(
object
):
class
TopicDocumentField
(
object
):
"""
"""
帖子索引字段信息
帖子索引字段信息
"""
"""
ID
=
"id"
,
ID
=
"id"
,
IS_ONLINE
=
"is_online"
,
IS_ONLINE
=
"is_online"
,
TAG_LIST
=
"tag_list"
TAG_LIST
=
"tag_list"
class
TopicPageType
(
object
):
class
TopicPageType
(
object
):
# 首页推荐
# 首页推荐
HOME_RECOMMEND
=
1
HOME_RECOMMEND
=
1
# 发现页面
# 发现页面
FIND_PAGE
=
2
FIND_PAGE
=
2
def
time_consuming_decorator
(
func
):
def
time_consuming_decorator
(
func
):
def
time_consuming
(
*
args
,
**
kwargs
):
def
time_consuming
(
*
args
,
**
kwargs
):
start_time
=
time
.
time
()
start_time
=
time
.
time
()
func
(
*
args
,
**
kwargs
)
func
(
*
args
,
**
kwargs
)
end_time
=
time
.
time
()
end_time
=
time
.
time
()
logging
.
info
(
"func consuming time:
%
fs"
%
(
end_time
-
start_time
))
logging
.
info
(
"func consuming time:
%
fs"
%
(
end_time
-
start_time
))
return
time_consuming
return
time_consuming
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