Browse Source

云相册抽取消息图、合成视频增加log

zhangdongming 2 years ago
parent
commit
6ee4ad8d73
1 changed files with 6 additions and 2 deletions
  1. 6 2
      Controller/Cron/CronCloudPhotoController.py

+ 6 - 2
Controller/Cron/CronCloudPhotoController.py

@@ -57,6 +57,8 @@ class CronCloudPhotoView(View):
         定时获取设备消息推送图
         定时获取设备消息推送图
         """
         """
         try:
         try:
+            now_time = int(time.time())
+            LOGGER.info('进入缓存uid进行获取消息推送图片进行对象copy:{}'.format(now_time))
             redis = RedisObject().CONN
             redis = RedisObject().CONN
             uid_set_cache = redis.lrange(UID_KEY, 0, -1)
             uid_set_cache = redis.lrange(UID_KEY, 0, -1)
             if not uid_set_cache:
             if not uid_set_cache:
@@ -64,7 +66,6 @@ class CronCloudPhotoView(View):
             uid_set_cache = list(uid_set_cache)
             uid_set_cache = list(uid_set_cache)
             today = datetime.date.today()
             today = datetime.date.today()
             time_stamp = cls.get_month_stamp()
             time_stamp = cls.get_month_stamp()
-            now_time = int(time.time())
             s3 = AmazonS3Util(ACCESS_KEY_ID, SECRET_ACCESS_KEY, REGION_NAME)
             s3 = AmazonS3Util(ACCESS_KEY_ID, SECRET_ACCESS_KEY, REGION_NAME)
             for item in uid_set_cache:
             for item in uid_set_cache:
                 try:
                 try:
@@ -102,6 +103,8 @@ class CronCloudPhotoView(View):
         缓存uid_set信息
         缓存uid_set信息
         """
         """
         try:
         try:
+            now_time = int(time.time())
+            LOGGER.info('进入读取开启云相册用户并把UID存在redis:{}'.format(now_time))
             photo_qs = DeviceCloudPhotoInfo.objects.filter(status=1).values('uid')
             photo_qs = DeviceCloudPhotoInfo.objects.filter(status=1).values('uid')
             if not photo_qs.exists():
             if not photo_qs.exists():
                 return response.json(0)
                 return response.json(0)
@@ -123,6 +126,8 @@ class CronCloudPhotoView(View):
         生成视频并存库
         生成视频并存库
         """
         """
         try:
         try:
+            now_time = int(time.time())
+            LOGGER.info('进入云相册开启用户,进行消息推送图进行合成视频:{}'.format(now_time))
             photo_qs = DeviceCloudPhotoInfo.objects.filter(status=1).values('uid', 'user_id')
             photo_qs = DeviceCloudPhotoInfo.objects.filter(status=1).values('uid', 'user_id')
             if not photo_qs.exists():
             if not photo_qs.exists():
                 return response.json(0)
                 return response.json(0)
@@ -130,7 +135,6 @@ class CronCloudPhotoView(View):
             poj_path = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
             poj_path = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
             time_stamp = cls.get_month_stamp()
             time_stamp = cls.get_month_stamp()
             s3 = AmazonS3Util(ACCESS_KEY_ID, SECRET_ACCESS_KEY, REGION_NAME)
             s3 = AmazonS3Util(ACCESS_KEY_ID, SECRET_ACCESS_KEY, REGION_NAME)
-            now_time = int(time.time())
             for item in photo_qs:
             for item in photo_qs:
                 try:
                 try:
                     with transaction.atomic():
                     with transaction.atomic():