Пример #1
0
    def _start_heartbeat_thread(self):
        if self._should_heartbeat and self._heartbeat_thread is None:
            refresh_seconds = conf.heartbeat_refresh_seconds()
            retry_seconds = conf.heartbeat_retry_seconds()

            if self._user_passed_heartbeat_thread is None:
                self._heartbeat_thread = _HeartbeatThread(self, refresh_seconds, retry_seconds)
            else:
                self._heartbeat_thread = self._user_passed_heartbeat_thread

            self._heartbeat_thread.daemon = True
            self._heartbeat_thread.start()
Пример #2
0
 def _start_heartbeat_thread(self):
     if self._should_heartbeat and self._heartbeat_thread is None:
         refresh_seconds = conf.heartbeat_refresh_seconds()
         retry_seconds = conf.heartbeat_retry_seconds()
         
         if self._user_passed_heartbeat_thread is None:
             self._heartbeat_thread = _HeartbeatThread(self, refresh_seconds, retry_seconds)
         else:
             self._heartbeat_thread = self._user_passed_heartbeat_thread
         
         self._heartbeat_thread.daemon = True
         self._heartbeat_thread.start()