优化下载次数统计代码

dependabot/npm_and_yarn/fir_admin/tmpl-1.0.5
youngS 3 years ago
parent 3ade1efadb
commit 4f0c8a302c
  1. 7
      fir_ser/api/utils/crontab/ctasks.py

@ -21,9 +21,10 @@ def sync_download_times():
key = "_".join([down_tem_key, '*'])
for app_download in cache.iter_keys(key):
count_hits = cache.get(app_download)
app_id = app_download.split(down_tem_key)[1].strip('_')
Apps.objects.filter(app_id=app_id).update(count_hits=count_hits)
logger.info(f"sync_download_times app_id:{app_id} count_hits:{count_hits}")
if count_hits:
app_id = app_download.split(down_tem_key)[1].strip('_')
Apps.objects.filter(app_id=app_id).update(count_hits=count_hits)
logger.info(f"sync_download_times app_id:{app_id} count_hits:{count_hits}")
def auto_clean_upload_tmp_file():

Loading…
Cancel
Save