|
@@ -214,12 +214,12 @@ class DevicePushService:
|
|
|
params['push_type'] = push_type
|
|
|
params['redis_obj'] = redis_obj
|
|
|
|
|
|
- GlobalThreadPool().submit(cls.send_app_msg_push, **params)
|
|
|
- # push_thread = threading.Thread(
|
|
|
- # target=cls.send_app_msg_push,
|
|
|
- # kwargs=params
|
|
|
- # )
|
|
|
- # push_thread.start()
|
|
|
+ # GlobalThreadPool().submit(cls.send_app_msg_push, **params)
|
|
|
+ push_thread = threading.Thread(
|
|
|
+ target=cls.send_app_msg_push,
|
|
|
+ kwargs=params
|
|
|
+ )
|
|
|
+ push_thread.start()
|
|
|
except Exception as e:
|
|
|
ERROR_INFO_LOGGER.info(
|
|
|
'推送消息线程异常,uid:{},error_line:{},error_msg:{}'
|
|
@@ -396,17 +396,17 @@ class DevicePushService:
|
|
|
else:
|
|
|
key = '{}/{}/{}_0.jpeg'.format(kwargs['uid'], kwargs['channel'], kwargs['n_time'])
|
|
|
# 开始异步推送图片
|
|
|
- thread_pool = GlobalThreadPool()
|
|
|
- thread_pool.submit(cls.async_send_picture_push, (
|
|
|
- push_type, kwargs['aws_s3_client'], kwargs['bucket'], key,
|
|
|
- kwargs['uid'], kwargs['appBundleId'], kwargs['token_val'], kwargs['event_type'], kwargs['n_time'],
|
|
|
- push_kwargs['msg_title'], push_kwargs['msg_text'], kwargs['channel'], kwargs['storage_location']))
|
|
|
-
|
|
|
- # push_thread = threading.Thread(target=cls.async_send_picture_push, args=(
|
|
|
+ # thread_pool = GlobalThreadPool()
|
|
|
+ # thread_pool.submit(cls.async_send_picture_push, (
|
|
|
# push_type, kwargs['aws_s3_client'], kwargs['bucket'], key,
|
|
|
# kwargs['uid'], kwargs['appBundleId'], kwargs['token_val'], kwargs['event_type'], kwargs['n_time'],
|
|
|
# push_kwargs['msg_title'], push_kwargs['msg_text'], kwargs['channel'], kwargs['storage_location']))
|
|
|
- # push_thread.start()
|
|
|
+
|
|
|
+ push_thread = threading.Thread(target=cls.async_send_picture_push, args=(
|
|
|
+ push_type, kwargs['aws_s3_client'], kwargs['bucket'], key,
|
|
|
+ kwargs['uid'], kwargs['appBundleId'], kwargs['token_val'], kwargs['event_type'], kwargs['n_time'],
|
|
|
+ push_kwargs['msg_title'], push_kwargs['msg_text'], kwargs['channel'], kwargs['storage_location']))
|
|
|
+ push_thread.start()
|
|
|
|
|
|
push_result = True
|
|
|
|