Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from celery.utils.log import get_logger 

2import sleek_lvalert 

3 

4log = get_logger(__name__) 

5 

6 

7class LVAlertClient(sleek_lvalert.LVAlertClient): 

8 

9 def __init__(self, *args, nodes=None, **kwargs): 

10 super().__init__(*args, **kwargs) 

11 self._needed_subscriptions = set(nodes or ()) 

12 self.add_event_handler('session_start', self._resubscribe) 

13 

14 def _resubscribe(self, event): 

15 log.info('Resubscribing to PubSub nodes') 

16 current_subscriptions = set(self.get_subscriptions()) 

17 self.subscribe(*(self._needed_subscriptions - current_subscriptions))