code: def stop_refreshing_token(self):
          
          with self.lock:
              self.timer_stopped = True
              self.timer.cancel()
docs: The timer needs to be canceled if the application is terminating, if not the timer will keep going.