Rev3827, Share FileServer between sites for non-main CLI commands

This commit is contained in:
shortcutme 2019-01-29 03:17:24 +01:00
parent 42f3f405ea
commit 31a7effa5f
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 6 additions and 3 deletions

View file

@ -13,7 +13,7 @@ class Config(object):
def __init__(self, argv):
self.version = "0.6.4"
self.rev = 3826
self.rev = 3827
self.argv = argv
self.action = None
self.pending_changes = {}

View file

@ -56,8 +56,11 @@ class Site(object):
if "main" in sys.modules and "file_server" in dir(sys.modules["main"]): # Use global file server by default if possible
self.connection_server = sys.modules["main"].file_server
else:
self.log.debug("Creating connection server") # remove
self.connection_server = FileServer()
if "main" in sys.modules:
sys.modules["main"].file_server = FileServer()
self.connection_server = sys.modules["main"].file_server
else:
self.connection_server = FileServer()
self.announcer = SiteAnnouncer(self) # Announce and get peer list from other nodes