Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
V
vest
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
2
Merge Requests
2
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
vest
Commits
6a3afab3
Commit
6a3afab3
authored
Dec 26, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
e956c403
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
process_time.py
moment/views/process_time.py
+7
-3
No files found.
moment/views/process_time.py
View file @
6a3afab3
...
...
@@ -151,14 +151,13 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
card_info
[
'have_comment_number'
]
=
0
now
=
datetime
.
datetime
.
now
()
createt
=
datetime
.
datetime
.
strptime
(
create_time
,
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
# nowt = now.strftime('%Y-%m-%d %H:%M:%S')
##获取创建时间和当前时间的相差秒数
# num = (now - createt).total_seconds()
num_days
=
(
now
-
createt
)
.
days
content_day_need_add_one_day
=
False
if
after_day
==
True
and
card_info
is
not
None
:
num_days
+=
repeat_time
content_day_need_add_one_day
=
True
logging
.
info
(
"get-----------------num_days:
%
s"
%
num_days
)
# 创建时间切换成分钟数便于比较
# mins = divmod(num, min)[0]
##根据转换后的分钟数进行比较
...
...
@@ -169,6 +168,8 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
return
get_time
,
time_region
elif
num_days
>=
1
and
num_days
<=
6
:
logging
.
info
(
"get-----------------num_days:
%
s"
%
num_days
)
get_time
=
get_one_six_days_random_time
(
content_level
=
content_level
,
num_days
=
num_days
,
action_type
=
action_type
,
content_day_need_add_one_day
=
content_day_need_add_one_day
)
...
...
@@ -176,6 +177,8 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
return
get_time
,
time_region
elif
num_days
>
6
and
num_days
<=
365
:
logging
.
info
(
"get-----------------num_days:
%
s"
%
num_days
)
get_time
=
get_ten_last_days_random_time
(
num_days
=
num_days
,
content_level
=
content_level
,
content_day_need_add_one_day
=
content_day_need_add_one_day
,
action_type
=
action_type
)
...
...
@@ -185,6 +188,7 @@ def get_content_time_by_create_time(create_time="", content_level=0, action_type
else
:
##需要删掉kafka的数据不再进行下发
return
[],
3
logging
.
info
(
"get-----------------get_time:
%
s"
%
get_time
)
except
:
logger
.
error
(
"catch exception,err_log:
%
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