Эх сурвалжийг харах

Merge branch 'master' of http://192.168.136.99:3000/servers/ASJServer

peng 1 жил өмнө
parent
commit
ff8ef892d6

+ 3 - 0
Controller/CloudStorage.py

@@ -378,6 +378,7 @@ class CloudStorageView(View):
         uid = uid_obj.UID
         uid = uid_obj.UID
         channel = uid_obj.channel
         channel = uid_obj.channel
         now_time = int(time.time())
         now_time = int(time.time())
+        LOGGER.info('请求获取sts:{}'.format(uid))
         try:
         try:
             uid_bucket_qs = UID_Bucket.objects.filter(uid=uid, endTime__gte=now_time, channel=channel).values(
             uid_bucket_qs = UID_Bucket.objects.filter(uid=uid, endTime__gte=now_time, channel=channel).values(
                 "bucket__mold",
                 "bucket__mold",
@@ -396,6 +397,7 @@ class CloudStorageView(View):
                 end_time = int(sts_crd_qs[0]["addTime"]) + 5000
                 end_time = int(sts_crd_qs[0]["addTime"]) + 5000
                 if end_time > now_time:
                 if end_time > now_time:
                     res = json.loads(sts_crd_qs[0]["data"])
                     res = json.loads(sts_crd_qs[0]["data"])
+                    LOGGER.info('请求获取sts响应1:{}'.format(uid))
                     return JsonResponse(status=200, data=res)
                     return JsonResponse(status=200, data=res)
 
 
             storage = '{uid}/vod{channel}/'.format(uid=uid, channel=channel)
             storage = '{uid}/vod{channel}/'.format(uid=uid, channel=channel)
@@ -454,6 +456,7 @@ class CloudStorageView(View):
             else:
             else:
                 StsCrdModel.objects.create(uid=uid, channel=channel, data=json.dumps(res, default=str),
                 StsCrdModel.objects.create(uid=uid, channel=channel, data=json.dumps(res, default=str),
                                            addTime=now_time, type=1)
                                            addTime=now_time, type=1)
+            LOGGER.info('请求获取sts响应2:{}'.format(uid))
             return JsonResponse(status=200, data=res)
             return JsonResponse(status=200, data=res)
         except Exception as e:
         except Exception as e:
             return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
             return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))

+ 3 - 4
Controller/UnicomCombo/UnicomComboTaskController.py

@@ -632,8 +632,7 @@ class UnicomComboTaskView(View):
     def async_save_today_use_float():
     def async_save_today_use_float():
         # 查询正在使用套餐并且大于等于2024年激活 不等于免费测试流量的订单数据
         # 查询正在使用套餐并且大于等于2024年激活 不等于免费测试流量的订单数据
         today = datetime.datetime.today()
         today = datetime.datetime.today()
-        yesterday = today - datetime.timedelta(days=1)
-        yesterday = yesterday.strftime('%Y%m%d')
+        n_data = today.strftime('%Y%m%d')
 
 
         start_time, end_time = LocalDateTimeUtil.get_start_and_end_time(today.strftime('%Y-%m-%d'), '%Y-%m-%d')
         start_time, end_time = LocalDateTimeUtil.get_start_and_end_time(today.strftime('%Y-%m-%d'), '%Y-%m-%d')
         o_combo_qs = UnicomComboOrderInfo.objects \
         o_combo_qs = UnicomComboOrderInfo.objects \
@@ -646,7 +645,7 @@ class UnicomComboTaskView(View):
                 return
                 return
 
 
             n_time = int(time.time())
             n_time = int(time.time())
-            day = yesterday[-2:]
+            day = n_data[-2:]
             iccid_list = []
             iccid_list = []
             for item in o_combo_qs:
             for item in o_combo_qs:
                 iccid = item['iccid']
                 iccid = item['iccid']
@@ -662,7 +661,7 @@ class UnicomComboTaskView(View):
                         iccid=iccid,
                         iccid=iccid,
                         order_id=item['order_id'],
                         order_id=item['order_id'],
                         card_type=1,
                         card_type=1,
-                        cycle=int(yesterday),  # 将日期转换为整数形式,如202201
+                        cycle=int(n_data),  # 将日期转换为整数形式,如202201
                         cycle_date=int(day),
                         cycle_date=int(day),
                         total_traffic=total_usage,
                         total_traffic=total_usage,
                         created_time=n_time,
                         created_time=n_time,