mirror of https://github.com/jumpserver/jumpserver
perf: debug pub sub
parent
05fc966444
commit
9b0c81333f
|
@ -47,6 +47,7 @@ class Subscription:
|
||||||
self.ch = pb.ch
|
self.ch = pb.ch
|
||||||
self.sub = sub
|
self.sub = sub
|
||||||
self.unsubscribed = False
|
self.unsubscribed = False
|
||||||
|
logger.info("Subscribed to channel: ", sub)
|
||||||
|
|
||||||
def _handle_msg(self, _next, error, complete):
|
def _handle_msg(self, _next, error, complete):
|
||||||
"""
|
"""
|
||||||
|
@ -105,10 +106,11 @@ class Subscription:
|
||||||
|
|
||||||
def unsubscribe(self):
|
def unsubscribe(self):
|
||||||
self.unsubscribed = True
|
self.unsubscribed = True
|
||||||
|
logger.info("Unsubscribed from channel: ", self.sub)
|
||||||
try:
|
try:
|
||||||
self.sub.close()
|
self.sub.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.debug('Unsubscribe msg error: {}'.format(e))
|
logger.warning('Unsubscribe msg error: {}'.format(e))
|
||||||
|
|
||||||
def retry(self, _next, error, complete):
|
def retry(self, _next, error, complete):
|
||||||
logger.info('Retry subscribe channel: {}'.format(self.ch))
|
logger.info('Retry subscribe channel: {}'.format(self.ch))
|
||||||
|
|
Loading…
Reference in New Issue