Commit bd002642 authored by 高雅喆's avatar 高雅喆

修改标签ctr的默认值

parent 0979f1c2
......@@ -236,15 +236,15 @@ class CollectData(object):
device_tag_ctr = LikeDeviceTagStat.objects.using(settings.SLAVE1_DB_NAME).filter(
device_id=device_id, tag_id=tag_id).values("tag_ctr_30")
if device_tag_ctr:
device_tag_ctr_value = device_tag_ctr[0].get("tag_ctr_30", 0.0)
device_tag_ctr_value = device_tag_ctr[0].get("tag_ctr_30", 1.0)
else:
device_tag_ctr_value = 0.0
device_tag_ctr_value = 1.0
logging.info("get_device_tag_ctr" + str(device_id) + str(tag_id))
return device_tag_ctr_value
except:
logging_exception()
logging.error("get_device_tag_ctr error!")
return 0.0
return 1.0
def consume_data_from_kafka(self,topic_name=None):
try:
......
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