Commit fdbdd5b5 authored by 段英荣's avatar 段英荣

modify

parent bed77193
......@@ -9,6 +9,8 @@ import logging
import traceback
import json
import pickle
from django.conf import settings
class LinUCB:
d = 2
......@@ -22,12 +24,9 @@ class LinUCB:
try:
if len(cls.default_tag_list) == 0:
query_item_results = Tag.objects.filter(is_online=True)
for item in query_item_results:
cls.default_tag_list.append(item.id)
cls.default_tag_list = Tag.objects.using(settings.SLAVE_DB_NAME).filter(is_online=True,collection=1).values_list("id",flat=True)[0:100]
return cls.default_tag_list[:20]
return cls.default_tag_list
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return list()
......
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