mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-12-16 09:02:49 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d16879d26 | ||
|
|
4b981fd93c |
@@ -47,7 +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)
|
logger.info(f"Subscribed to channel: {sub}")
|
||||||
|
|
||||||
def _handle_msg(self, _next, error, complete):
|
def _handle_msg(self, _next, error, complete):
|
||||||
"""
|
"""
|
||||||
@@ -106,11 +106,11 @@ class Subscription:
|
|||||||
|
|
||||||
def unsubscribe(self):
|
def unsubscribe(self):
|
||||||
self.unsubscribed = True
|
self.unsubscribed = True
|
||||||
logger.info("Unsubscribed from channel: ", self.sub)
|
logger.info(f"Unsubscribed from channel: {self.sub}")
|
||||||
try:
|
try:
|
||||||
self.sub.close()
|
self.sub.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning('Unsubscribe msg error: {}'.format(e))
|
logger.warning(f'Unsubscribe msg error: {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))
|
||||||
|
|||||||
@@ -20,3 +20,4 @@ def get_current_request():
|
|||||||
|
|
||||||
|
|
||||||
current_request = LocalProxy(partial(_find, 'current_request'))
|
current_request = LocalProxy(partial(_find, 'current_request'))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user