Skip to content

Commit

Permalink
fixed server
Browse files Browse the repository at this point in the history
  • Loading branch information
latentvector committed Mar 20, 2024
1 parent ce97ffe commit c01ef2d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
16 changes: 8 additions & 8 deletions commune/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def __init__(
name = module.__class__.__name__
self.name = name


if hasattr(module, 'schema'):
self.schema = module.schema()
else:
Expand All @@ -65,19 +64,20 @@ def __init__(
module.address = self.address

self.module = module
self.set_key(key)
self.access_module = c.module(access_module)(module=self.module)
self.set_history_path(history_path)
self.set_key(key)

self.set_api(ip=self.ip, port=self.port)



def set_key(self, key):
self.key = key
if self.key == None:
self.key = c.get_key(self.name)
if isinstance(self.key, str):
self.key = c.get_key(self.key)
self.module.key = self.key
if key == None:
key = c.get_key(self.name)
if isinstance(key, str):
key = c.get_key(key)
self.key = self.module.key = key
c.print(f'🔑 Key: {self.key} 🔑\033')


Expand Down
13 changes: 8 additions & 5 deletions commune/vali/vali.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,14 @@ def vote_staleness(self):
def vote_loop(self):

while True:
r = self.vote(cache_exceptions=True)

run_info = self.run_info()
c.print(run_info, color='cyan')
c.sleep(self.config.sleep_interval)
try:
r = self.vote(cache_exceptions=True)
c.print(r)
run_info = self.run_info()
c.print(run_info, color='cyan')
c.sleep(self.config.sleep_interval)
except Exception as e:
c.print(c.detailed_error(e))


Vali.run(__name__)

0 comments on commit c01ef2d

Please sign in to comment.