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
e9d0fdab
Commit
e9d0fdab
authored
Sep 26, 2019
by
高雅喆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
like stat alter
parent
221dce25
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
redis_new_topic_sub.py
trans2es/management/commands/redis_new_topic_sub.py
+3
-3
trans2es_data2es_parallel.py
trans2es/management/commands/trans2es_data2es_parallel.py
+3
-3
No files found.
trans2es/management/commands/redis_new_topic_sub.py
View file @
e9d0fdab
...
...
@@ -4,7 +4,7 @@ import datetime
from
libs.cache
import
redis_client
from
libs.error
import
logging_exception
from
django.conf
import
settings
from
trans2es.models.portrait_stat
import
Like
DeviceTag
Stat
from
trans2es.models.portrait_stat
import
Like
Topic
Stat
try
:
ps
=
redis_client
.
pubsub
()
...
...
@@ -28,9 +28,9 @@ try:
insert_list
=
[]
for
topic
in
insert_topic_ids
:
insert_list
.
append
(
Like
DeviceTag
Stat
(
create_time
=
datetime
.
datetime
.
today
(),
update_time
=
datetime
.
datetime
.
today
(),
Like
Topic
Stat
(
create_time
=
datetime
.
datetime
.
today
(),
update_time
=
datetime
.
datetime
.
today
(),
topic_id
=
topic
,
is_new_topic
=
0
,
topic_ctr_30
=
0.0
,
like_rate_30
=
0.0
))
Like
DeviceTag
Stat
.
objects
.
using
(
settings
.
MASTER_DB_NAME
)
.
bulk_create
(
insert_list
)
Like
Topic
Stat
.
objects
.
using
(
settings
.
MASTER_DB_NAME
)
.
bulk_create
(
insert_list
)
logging
.
info
(
"impressions count gt 100 topic ids"
+
str
(
insert_topic_ids
))
json_all_new_topic_impression_count
=
json
.
dumps
(
all_new_topic_impression_count
)
logging
.
info
(
"all_new_topic_impression_count"
+
str
(
all_new_topic_impression_count
))
...
...
trans2es/management/commands/trans2es_data2es_parallel.py
View file @
e9d0fdab
...
...
@@ -34,7 +34,7 @@ from trans2es.models.tag import Tag
from
libs.cache
import
redis_client
from
trans2es.models.tag
import
TopicTag
from
libs.error
import
logging_exception
from
trans2es.models.portrait_stat
import
Like
DeviceTag
Stat
from
trans2es.models.portrait_stat
import
Like
Topic
Stat
...
...
@@ -241,10 +241,10 @@ class Command(BaseCommand):
insert_list
=
[]
for
topic
in
insert_topic_ids
:
insert_list
.
append
(
Like
DeviceTag
Stat
(
create_time
=
datetime
.
datetime
.
today
(),
Like
Topic
Stat
(
create_time
=
datetime
.
datetime
.
today
(),
update_time
=
datetime
.
datetime
.
today
(),
topic_id
=
topic
,
is_new_topic
=
0
,
topic_ctr_30
=
0.0
,
like_rate_30
=
0.0
))
Like
DeviceTag
Stat
.
objects
.
using
(
settings
.
MASTER_DB_NAME
)
.
bulk_create
(
insert_list
)
Like
Topic
Stat
.
objects
.
using
(
settings
.
MASTER_DB_NAME
)
.
bulk_create
(
insert_list
)
logging
.
info
(
"impressions count gt 100 topic ids"
+
str
(
insert_topic_ids
))
json_all_new_topic_impression_count
=
json
.
dumps
(
all_new_topic_impression_count
)
logging
.
info
(
"all_new_topic_impression_count"
+
str
(
all_new_topic_impression_count
))
...
...
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