minermedic/miners/base_miner.py
def restart_miner(self):

        """
        Attempts to restart the miner. This is a wrapper for "miner.restart()".
        The actual "restart" method must be implemented individually for each subclass of Miner.

        Returns:
            boolean

        """

        success = False

        # can we still ping this miner?
        if self.object_states.ping_error == 0:

            # we can still ping it, so attempt to restart miner
            logger.debug("Attempt to restart object {}".format(self.id))

            success = False
            self.__init_restart_delay(self.object)

            # should we restart it?
            restart = time_functions.get_timeout_expired(self.last_restart_time, self.restart_delay)

            if restart:

                # do the actual restart
                success = self.restart()

                # set the last restart attempt time
                self.last_restart_time = time_functions.current_milli_time()

                if success:

                    # reset the init state so state machine does not try to auto-powercycle, etc.
                    self._reset_init_state()

                    logger.info("Restarted Miner {}(ID={})".format(self.object.unique_id, self.object.id))
                else:
                    # according to state machine diagram, if restart fails, powercycle (OR OFF)
                    success = self.powercycle()

        return success

        Attempts to restart the miner. This is a wrapper for "miner.restart()".
        The actual "restart" method must be implemented individually for each subclass of Miner.

        Returns:
            boolean

        
Attempts to restart the miner. This is a wrapper for "miner.restart()".
The actual "restart" method must be implemented individually for each subclass of Miner.
Attempts to restart the miner . This is a wrapper for " miner . restart () " . The actual " restart " method must be implemented individually for each subclass of Miner .
def restart_miner(self):
        success = False
        if self.object_states.ping_error == 0:
            logger.debug("Attempt to restart object {}".format(self.id))
            success = False
            self.__init_restart_delay(self.object)
            restart = time_functions.get_timeout_expired(self.last_restart_time, self.restart_delay)
            if restart:
                success = self.restart()
                self.last_restart_time = time_functions.current_milli_time()
                if success:
                    self._reset_init_state()
                    logger.info("Restarted Miner {}(ID={})".format(self.object.unique_id, self.object.id))
                else:
                    success = self.powercycle()
        return success
def restart_miner ( self ) : success = False if self . object_states . ping_error == 0 : logger . debug ( "Attempt to restart object {}" . format ( self . id ) ) success = False self . __init_restart_delay ( self . object ) restart = time_functions . get_timeout_expired ( self . last_restart_time , self . restart_delay ) if restart : success = self . restart ( ) self . last_restart_time = time_functions . current_milli_time ( ) if success : self . _reset_init_state ( ) logger . info ( "Restarted Miner {}(ID={})" . format ( self . object . unique_id , self . object . id ) ) else : success = self . powercycle ( ) return success
Attempts to restart the miner.
Attempts to restart the miner .
"""
        Attempts to restart the miner. This is a wrapper for "miner.restart()".
        The actual "restart" method must be implemented individually for each subclass of Miner.

        Returns:
            boolean

        """ # can we still ping this miner? # we can still ping it, so attempt to restart miner # should we restart it? # do the actual restart # set the last restart attempt time # reset the init state so state machine does not try to auto-powercycle, etc. # according to state machine diagram, if restart fails, powercycle (OR OFF)
None
self