Compare commits
4 commits
554e65cbd3
...
637feaee55
| Author | SHA1 | Date | |
|---|---|---|---|
| 637feaee55 | |||
| 91dbea8f10 | |||
| c979940706 | |||
| 616a06270d |
6 changed files with 13 additions and 10 deletions
|
|
@ -542,6 +542,8 @@ class Nodes(Thread):
|
|||
self.queue('pull')
|
||||
|
||||
def _pull(self):
|
||||
if not state.sync_enabled or settings.preferences.get('downloadRate') == 0:
|
||||
return
|
||||
if state.activity and state.activity.get('activity') == 'import':
|
||||
return
|
||||
self._pulling = True
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import sys
|
|||
import signal
|
||||
import time
|
||||
|
||||
from tornado.httpserver import HTTPServer
|
||||
from tornado.ioloop import IOLoop
|
||||
from tornado.web import StaticFileHandler, Application
|
||||
|
||||
|
|
@ -71,7 +70,6 @@ def shutdown():
|
|||
logger.debug('shutdown downloads')
|
||||
state.downloads.join()
|
||||
logger.debug('shutdown http_server')
|
||||
state.http_server.stop()
|
||||
if state.tasks:
|
||||
logger.debug('shutdown tasks')
|
||||
state.tasks.join()
|
||||
|
|
@ -135,8 +133,9 @@ def run():
|
|||
]
|
||||
|
||||
setup.create_db()
|
||||
http_server = HTTPServer(Application(handlers, **options))
|
||||
http_server.listen(settings.server['port'], settings.server['address'])
|
||||
http_server = Application(handlers, **options)
|
||||
max_buffer_size = 2*1024*1024*1024
|
||||
http_server.listen(settings.server['port'], settings.server['address'], max_buffer_size=max_buffer_size)
|
||||
|
||||
if PID:
|
||||
with open(PID, 'w') as pid:
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ node = False
|
|||
online = False
|
||||
tasks = False
|
||||
downloads = False
|
||||
sync_enabled = True
|
||||
tor = False
|
||||
update = False
|
||||
shutdown = False
|
||||
|
|
|
|||
|
|
@ -333,7 +333,9 @@ class Update(Thread):
|
|||
def install(self):
|
||||
while update_available():
|
||||
self.status('Downloading...')
|
||||
while not download():
|
||||
max_retry = 5
|
||||
while max_retry > 0 and not download():
|
||||
max_retry -= 1
|
||||
self.status('Download failed, retrying...')
|
||||
time.sleep(5)
|
||||
self.status('Downloading...')
|
||||
|
|
|
|||
|
|
@ -57,11 +57,10 @@ class Handler(WebSocketHandler):
|
|||
|
||||
def post(self, event, data):
|
||||
message = json_dumps([event, data])
|
||||
main = IOLoop.instance()
|
||||
if self.ws_connection is None:
|
||||
self.on_close()
|
||||
else:
|
||||
main.add_callback(lambda: self.write_message(message))
|
||||
state.main.add_callback(lambda: self.write_message(message))
|
||||
|
||||
def trigger_event(event, data):
|
||||
#if len(state.websockets):
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
requests==2.9.1
|
||||
tornado==4.3
|
||||
requests==2.21.0
|
||||
tornado==5.1.1
|
||||
chardet
|
||||
html5lib
|
||||
#ox>=2.0.666
|
||||
|
|
@ -8,5 +8,5 @@ python-stdnum==1.2
|
|||
PyPDF2==1.25.1
|
||||
pysocks
|
||||
stem
|
||||
sqlitedict==1.4.0
|
||||
sqlitedict==1.6.0
|
||||
zeroconf
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue