code: async def __check_last_ping(self, run_listen):
          
          if self.__last_ping < time.time()-10:
              self._logger.warning("Last ping too old. Restarting the agent.")
              run_listen.cancel()
              self.__cancel_remaining_safe_tasks()
          else:
              self._loop.call_later(1, self._create_safe_task, self.__check_last_ping(run_listen))
docs: Check if the last timeout is too old. If it is, kills the run_listen task