Commit 4396340f authored by 段英荣's avatar 段英荣

Merge branch 'add_sentry' into 'master'

add_sentry

See merge request alpha/physical!440
parents 4bd4da57 5c17f023
......@@ -15,6 +15,7 @@ from libs.es import ESPerform
from search.utils.common import *
import libs.tools as Tools
from trans2es.models.pictorial import CommunityPictorialHomeFeed
from libs.error import logging_exception
class KafkaManager(object):
consumser_obj = None
......@@ -53,6 +54,7 @@ class CollectData(object):
return redis_linucb_tag_data_dict
except:
logging_exception()
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return dict()
......@@ -143,6 +145,7 @@ class CollectData(object):
return True
except:
logging_exception()
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return False
......@@ -151,6 +154,7 @@ class CollectData(object):
user_feature = user_feature if user_feature else self.user_feature
return LinUCB.update_linucb_info(user_feature, reward, tag_id, device_id,self.linucb_matrix_redis_prefix,redis_client)
except:
logging_exception()
logging.error("update_user_linucb_tag_info error!")
return False
......@@ -308,9 +312,11 @@ class CollectData(object):
else:
logging.warning("unknown type msg:%s" % raw_val_dict.get("type", "missing type"))
except:
logging_exception()
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return True
except:
logging_exception()
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return False
......@@ -10,7 +10,7 @@ import traceback
import json
import pickle
from django.conf import settings
from libs.error import logging_exception
class LinUCB:
d = 2
......@@ -33,6 +33,7 @@ class LinUCB:
return cls.default_tag_list
except:
logging_exception()
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return list()
......@@ -103,6 +104,7 @@ class LinUCB:
logging.info("duan add,device_id:%s,sorted_np_score_list:%s,np_score_dict:%s" % (str(device_id), str(sorted_np_score_list), str(np_score_dict)))
return (top_tag_dict,top_tag_set)
except:
logging_exception()
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return ({},())
......@@ -126,6 +128,7 @@ class LinUCB:
return True
except:
logging_exception()
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return False
......@@ -164,5 +167,6 @@ class LinUCB:
redis_cli.hset(redis_key, tag_id, pickle.dumps(user_tag_dict))
return True
except:
logging_exception()
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return False
\ No newline at end of file
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