Commit 7cd08a93 authored by 赵威's avatar 赵威

try get cpc data

parent e970d1af
......@@ -10,7 +10,7 @@ from models.esmm.fe import device_fe, diary_fe, tractate_fe
from models.esmm.tractate_model import model_predict_tractate
from utils.cache import get_essm_model_save_path, redis_client2
from utils.grey import recommed_service_category_device_id_by_tail
from utils.portrait import (get_user_portrait_tag3_read_v2, user_portrait_tag3_get_candidate_dict,
from utils.portrait import (get_cpc_diary_list, get_user_portrait_tag3_read_v2, user_portrait_tag3_get_candidate_dict,
user_portrait_tag3_get_candidate_unread_list, user_portrait_tag3_get_ctcvr_queue,
user_portrait_tag3_write_ctcvr_data)
......@@ -140,7 +140,10 @@ def main():
if __name__ == "__main__":
time_begin = time.time()
main()
# main()
lst = get_cpc_diary_list()
print(lst)
total_time = (time.time() - time_begin) / 60
print("total cost {:.2f} mins at {}".format(total_time, datetime.datetime.now()))
......@@ -3,7 +3,7 @@ import json
import random
from itertools import chain, zip_longest
from .cache import redis_client2, redis_client4
from .cache import redis_client2, redis_client3, redis_client4
# merge_lists([1, 2], [3, 5, 6, 7], [4])
......@@ -195,6 +195,14 @@ def user_portrait_tag3_get_candidate_unread_list(device_id, content_type, size=5
return queue
def get_cpc_diary_list():
key = "strategy:cpc_diary_list"
data = redis_client3.get(key)
if data:
return json.loads(data)
return []
def user_portrait_tag3_write_ctcvr_data(device_id, content_type, data):
"""
device_id:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment