Feature task manager
Merge request reports
Activity
Filter activity
84 if status is not True: 85 done = False 86 87 logger.debug(f'Verify level task(s) done?{done}') 88 89 elif task_name in current['notify']: 90 current['verify'][task_name] = success 91 routing_key = 'complete.' + username 92 done = success 93 94 logger.debug(f'Notify level task(s) done?{done}') 95 96 except Exception as exception: 97 logger.error('', exc_info=True) 98 99 if done: Created by: rtripath89
done=False variable needs to be defined outside if-else statements, else it gives the following error:
2020-04-24 17:07:50,009 [blocking_connection] - Created channel=1 Traceback (most recent call last): File "task_manager.py", line 126, in <module> 'cb': task_manager File "/opt/rabbitmq_agents/rc_rmq.py", line 111, in start_consume self._channel.start_consuming() File "/usr/local/lib/python3.6/site-packages/pika/adapters/blocking_connection.py", line 1866, in start_consuming self._process_data_events(time_limit=None) File "/usr/local/lib/python3.6/site-packages/pika/adapters/blocking_connection.py", line 2027, in _process_data_events self.connection.process_data_events(time_limit=time_limit) File "/usr/local/lib/python3.6/site-packages/pika/adapters/blocking_connection.py", line 834, in process_data_events self._dispatch_channel_events() File "/usr/local/lib/python3.6/site-packages/pika/adapters/blocking_connection.py", line 566, in _dispatch_channel_events impl_channel._get_cookie()._dispatch_events() File "/usr/local/lib/python3.6/site-packages/pika/adapters/blocking_connection.py", line 1494, in _dispatch_events evt.properties, evt.body) File "task_manager.py", line 100, in task_manager if done: UnboundLocalError: local variable 'done' referenced before assignment
solved in 8a7f1f0b
Please register or sign in to reply