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=1Traceback (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
Created by: rtripath89
done=False variable needs to be defined outside if-else statements, else it gives the following error:
solved in 8a7f1f0b