Skip to content

Commit

Permalink
complements run.py to throw exception on dereg
Browse files Browse the repository at this point in the history
  • Loading branch information
p-ferreira committed Sep 14, 2023
1 parent 38ce532 commit 2b2cf6e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions openvalidators/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# DEALINGS IN THE SOFTWARE.

import asyncio
import time
import bittensor as bt
from traceback import print_exception

Expand All @@ -25,8 +24,6 @@
from openvalidators.weights import should_set_weights, set_weights
from openvalidators.misc import ttl_get_block

SLEEP_TIME = 180

# Neuron run loop.`
def run(self):
bt.logging.info("run()")
Expand All @@ -35,9 +32,7 @@ def run(self):
try:
while True:
if not self.wallet.hotkey.ss58_address in self.metagraph.hotkeys:
bt.logging.info(f"Validator is not registered - sleeping for {SLEEP_TIME} seconds")
time.sleep(SLEEP_TIME)
continue
raise Exception(f"Validator is not registered - hotkey {self.wallet.hotkey.ss58_address} not in metagraph")
bt.logging.info(f"step({self.step}) block({ttl_get_block( self )})")

# Run multiple forwards.
Expand Down

0 comments on commit 2b2cf6e

Please sign in to comment.