Compare commits

..

No commits in common. "637feaee55f757aa7877ae15681ff352b0f22dc2" and "554e65cbd39d31b6f8b601bf7f90587a84173e8e" have entirely different histories.

6 changed files with 10 additions and 13 deletions

View file

@ -542,8 +542,6 @@ class Nodes(Thread):
self.queue('pull') self.queue('pull')
def _pull(self): def _pull(self):
if not state.sync_enabled or settings.preferences.get('downloadRate') == 0:
return
if state.activity and state.activity.get('activity') == 'import': if state.activity and state.activity.get('activity') == 'import':
return return
self._pulling = True self._pulling = True

View file

@ -6,6 +6,7 @@ import sys
import signal import signal
import time import time
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop from tornado.ioloop import IOLoop
from tornado.web import StaticFileHandler, Application from tornado.web import StaticFileHandler, Application
@ -70,6 +71,7 @@ def shutdown():
logger.debug('shutdown downloads') logger.debug('shutdown downloads')
state.downloads.join() state.downloads.join()
logger.debug('shutdown http_server') logger.debug('shutdown http_server')
state.http_server.stop()
if state.tasks: if state.tasks:
logger.debug('shutdown tasks') logger.debug('shutdown tasks')
state.tasks.join() state.tasks.join()
@ -133,9 +135,8 @@ def run():
] ]
setup.create_db() setup.create_db()
http_server = Application(handlers, **options) http_server = HTTPServer(Application(handlers, **options))
max_buffer_size = 2*1024*1024*1024 http_server.listen(settings.server['port'], settings.server['address'])
http_server.listen(settings.server['port'], settings.server['address'], max_buffer_size=max_buffer_size)
if PID: if PID:
with open(PID, 'w') as pid: with open(PID, 'w') as pid:

View file

@ -8,7 +8,6 @@ node = False
online = False online = False
tasks = False tasks = False
downloads = False downloads = False
sync_enabled = True
tor = False tor = False
update = False update = False
shutdown = False shutdown = False

View file

@ -333,9 +333,7 @@ class Update(Thread):
def install(self): def install(self):
while update_available(): while update_available():
self.status('Downloading...') self.status('Downloading...')
max_retry = 5 while not download():
while max_retry > 0 and not download():
max_retry -= 1
self.status('Download failed, retrying...') self.status('Download failed, retrying...')
time.sleep(5) time.sleep(5)
self.status('Downloading...') self.status('Downloading...')

View file

@ -57,10 +57,11 @@ class Handler(WebSocketHandler):
def post(self, event, data): def post(self, event, data):
message = json_dumps([event, data]) message = json_dumps([event, data])
main = IOLoop.instance()
if self.ws_connection is None: if self.ws_connection is None:
self.on_close() self.on_close()
else: else:
state.main.add_callback(lambda: self.write_message(message)) main.add_callback(lambda: self.write_message(message))
def trigger_event(event, data): def trigger_event(event, data):
#if len(state.websockets): #if len(state.websockets):

View file

@ -1,5 +1,5 @@
requests==2.21.0 requests==2.9.1
tornado==5.1.1 tornado==4.3
chardet chardet
html5lib html5lib
#ox>=2.0.666 #ox>=2.0.666
@ -8,5 +8,5 @@ python-stdnum==1.2
PyPDF2==1.25.1 PyPDF2==1.25.1
pysocks pysocks
stem stem
sqlitedict==1.6.0 sqlitedict==1.4.0
zeroconf zeroconf