ONSdigital / sdx-seft-publisher-service

Microservice for publishing SEFT files from internal to RAS
MIT License
0 stars 1 forks source link

Publish_message method does not cope with disconnection. #39

Closed Dave-Haynes closed 7 years ago

Dave-Haynes commented 7 years ago

A client can call _publishmessage during a reconnection cycle, ie: when self._channel is None. This results in an exception.

Dave-Haynes commented 7 years ago

Traceback (most recent call last): File "/opt/sdx-seft-publisher-service/v-sdx-seft-publisher-service/lib/python3.4/site-packages/tornado/ioloop.py", line 1026, in _run return self.callback() File "app/main.py", line 168, in transfer_files msg_id = self.publisher.publish_message(payload, headers=headers) File "/opt/sdx-seft-publisher-service/app/publisher.py", line 159, in publish_message self._channel.basic_publish( AttributeError: 'NoneType' object has no attribute 'basic_publish'