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

update

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