Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
when raise MQ connection lost, skip iconservice close (#70)
Browse files Browse the repository at this point in the history
* when raise MQ connection lost skip iconservice close

* typo fix
  • Loading branch information
cow-hs committed Jan 10, 2019
1 parent 8e1e5e2 commit cb8cf57
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.2.11
1.1.2.12
14 changes: 10 additions & 4 deletions iconservice/icon_inner_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,11 @@ class IconScoreInnerService(MessageQueueService[IconScoreInnerTask]):
TaskType = IconScoreInnerTask

def _callback_connection_lost_callback(self, connection: 'RobustConnection'):
Logger.error("MQ Connection lost.")
self.clean_close()
Logger.error("MQ Connection lost. [Service]")
# self.clean_close()

def _callback_connection_reconnect_callback(self, connection: 'RobustConnection'):
Logger.error("MQ Connection reconnect. [Service]")

def clean_close(self):
self._task._close()
Expand All @@ -268,5 +271,8 @@ class IconScoreInnerStub(MessageQueueStub[IconScoreInnerTask]):
TaskType = IconScoreInnerTask

def _callback_connection_lost_callback(self, connection: 'RobustConnection'):
Logger.error("MQ Connection lost.")
self._task._close()
Logger.error("MQ Connection lost. [Stub]")
# self._task._close()

def _callback_connection_reconnect_callback(self, connection: 'RobustConnection'):
Logger.error("MQ Connection reconnect. [Service]")
2 changes: 1 addition & 1 deletion iconservice/icon_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def run_in_foreground(conf: 'IconConfig'):


def _run_async(async_func):
loop = asyncio.new_event_loop()
loop = MessageQueueService.loop
return loop.run_until_complete(async_func)


Expand Down

0 comments on commit cb8cf57

Please sign in to comment.