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