jukebox.py
def _refresh(self) -> None:
        """A function running in a separate daemon thread which will refresh spotify credentials"""
        interval = 5 * 60  # testing every 5 minutes to keep connection alive
        while True:
            try:
                logging.debug("Locking FSM for refresh")
                with self._lock:
                    self.token, self.sp = refresh_token(
                        self.sp_auth, self.sp, self.token
                    )
                # Make sure jukebox did not change id
                self.device_id = get_jukebox_id(self.sp)
                logging.debug("Refresh completed, unlocking FSM")
                time.sleep(interval)
            except socket.error:
                logging.debug(
                    "There was a socket error. Refresh unable to be completed. Retrying in 1 minute..."
                )
                time.sleep(60)
A function running in a separate daemon thread which will refresh spotify credentials
A function running in a separate daemon thread which will refresh spotify credentials
A function running in a separate daemon thread which will refresh spotify credentials
def _refresh(self) -> None:
        interval = 5 * 60  
        while True:
            try:
                logging.debug("Locking FSM for refresh")
                with self._lock:
                    self.token, self.sp = refresh_token(
                        self.sp_auth, self.sp, self.token
                    )
                self.device_id = get_jukebox_id(self.sp)
                logging.debug("Refresh completed, unlocking FSM")
                time.sleep(interval)
            except socket.error:
                logging.debug(
                    "There was a socket error. Refresh unable to be completed. Retrying in 1 minute..."
                )
                time.sleep(60)
def _refresh ( self ) -> None : interval = 5 * 60 while True : try : logging . debug ( "Locking FSM for refresh" ) with self . _lock : self . token , self . sp = refresh_token ( self . sp_auth , self . sp , self . token ) self . device_id = get_jukebox_id ( self . sp ) logging . debug ( "Refresh completed, unlocking FSM" ) time . sleep ( interval ) except socket . error : logging . debug ( "There was a socket error. Refresh unable to be completed. Retrying in 1 minute..." ) time . sleep ( 60 )
A function running in a separate daemon thread which will refresh spotify credentials
A function running in a separate daemon thread which will refresh spotify credentials
"""A function running in a separate daemon thread which will refresh spotify credentials""" # testing every 5 minutes to keep connection alive # Make sure jukebox did not change id
self