Bläddra i källkod

推送时间改为服务器当前时间

locky 2 år sedan
förälder
incheckning
362285fd8f
1 ändrade filer med 4 tillägg och 2 borttagningar
  1. 4 2
      Controller/DetectControllerV2.py

+ 4 - 2
Controller/DetectControllerV2.py

@@ -1,5 +1,6 @@
 import json
 import logging
+import time
 
 from django.http import JsonResponse
 from django.views.generic.base import View
@@ -111,14 +112,15 @@ class NotificationV2View(View):
                 aws_s3_client = DevicePushService.get_s3_client(region=region)
                 bucket = 'foreignpush' if region == 1 else 'push'
 
+            now_time = time.time()
             kwag_args = {
                 'uid': uid,
                 'channel': channel,
                 'event_type': event_type,
-                'n_time': n_time,
+                'n_time': now_time,
             }
             params = {'nickname': nickname, 'uid': uid, 'kwag_args': kwag_args, 'is_st': is_st, 'region': region,
-                      'is_sys_msg': is_sys_msg, 'channel': channel, 'event_type': event_type, 'n_time': n_time,
+                      'is_sys_msg': is_sys_msg, 'channel': channel, 'event_type': event_type, 'n_time': now_time,
                       'electricity': electricity, 'bucket': bucket, 'aws_s3_client': aws_s3_client,
                       'app_push': cache_app_push, 'storage_location': 2, 'ai_type': ai_type, 'device_type': device_type,
                       'dealings_type': dealings_type, 'detection': detection,