Only start onions in passive mode
This commit is contained in:
parent
0e13fbf5dc
commit
17ddbd8b32
1 changed files with 3 additions and 2 deletions
|
@ -185,7 +185,8 @@ class FileServer(ConnectionServer):
|
||||||
gevent.spawn(self.checkSite, site, check_files)
|
gevent.spawn(self.checkSite, site, check_files)
|
||||||
|
|
||||||
self.openport()
|
self.openport()
|
||||||
self.tor_manager.startOnions()
|
if self.port_opened is False:
|
||||||
|
self.tor_manager.startOnions()
|
||||||
|
|
||||||
if not sites_checking:
|
if not sites_checking:
|
||||||
for address, site in self.sites.items(): # Check sites integrity
|
for address, site in self.sites.items(): # Check sites integrity
|
||||||
|
@ -243,7 +244,7 @@ class FileServer(ConnectionServer):
|
||||||
last_time = time.time()
|
last_time = time.time()
|
||||||
while 1:
|
while 1:
|
||||||
time.sleep(30)
|
time.sleep(30)
|
||||||
if time.time() - max(self.last_request, last_time) > 60*3: # If taken more than 3 minute then the computer was in sleep mode
|
if time.time() - max(self.last_request, last_time) > 60 * 3: # If taken more than 3 minute then the computer was in sleep mode
|
||||||
self.log.info(
|
self.log.info(
|
||||||
"Wakeup detected: time wrap from %s to %s (%s sleep seconds), acting like startup..." %
|
"Wakeup detected: time wrap from %s to %s (%s sleep seconds), acting like startup..." %
|
||||||
(last_time, time.time(), time.time() - last_time)
|
(last_time, time.time(), time.time() - last_time)
|
||||||
|
|
Loading…
Reference in a new issue