fix: 保存last_tag_id以减少获取mplog
This commit is contained in:
parent
c3d0fa1806
commit
3fbe3e7d0e
|
@ -40,6 +40,8 @@ def get_tag_val():
|
|||
mr_one.tag_id, mr_one.tag_val, mr_one.tag_code, mr_one.tag_update = row
|
||||
mr_one.mpoint, _ = Mpoint.objects.get_or_create(code=mr_one.tag_code, defaults={'name': mr_one.tag_code, 'code': mr_one.tag_code, 'unit': 'unknown'})
|
||||
mr_one.save()
|
||||
last_tag_id = mr_one.tag_id
|
||||
cache.set('last_tag_id', last_tag_id)
|
||||
|
||||
@shared_task(base=CustomTask)
|
||||
def cal_mpointstat_hour(mpointId: str, year: int, month: int, day: int, hour: int):
|
||||
|
|
Loading…
Reference in New Issue