funboost icon indicating copy to clipboard operation
funboost copied to clipboard

接受非booster传过来的消息,没有extra, 导致consume 失败

Open LeeC20 opened this issue 2 years ago • 1 comments

版本41.2
脚本:basic_consumer.py line: 512 我改成下面这样 就能运行

    # noinspection PyProtectedMember
def _run(self, kw: dict, ):

    try:
        t_start_run_fun = time.time()
        max_retry_times = self._get_priority_conf(kw, 'max_retry_times')
        current_function_result_status = FunctionResultStatus(self.queue_name, self.consuming_function.__name__, kw['body'], )
        current_retry_times = 0
        function_only_params = delete_keys_and_return_new_dict(kw['body'])
        if "extra" not in kw['body']:
            extra_params = {'task_id': kw['body']['task_id'], 'publish_time': round(time.time(), 4),
                            'publish_time_format': time.strftime('%Y-%m-%d %H:%M:%S')}

            kw["body"]['extra'] = extra_params

LeeC20 avatar Jan 10 '24 11:01 LeeC20

taskid 等额外信息放在extra字典里面

ydf0509 avatar Feb 20 '24 02:02 ydf0509