get preview in tasks

This commit is contained in:
j 2016-01-24 13:14:43 +05:30
commit 5c5c8ac39b
4 changed files with 26 additions and 16 deletions

View file

@ -369,12 +369,11 @@ class Node(Thread):
return True
except:
logger.debug('preview download failed %s', url, exc_info=1)
return False
elif code == 404:
pass
else:
logger.debug('FAILED %s', url)
return False
return False
def download_upgrade(self, release):
for module in release['modules']:
@ -422,7 +421,6 @@ class Nodes(Thread):
Thread.__init__(self)
self.daemon = True
self.start()
self.pull()
def cleanup(self):
if self._running and self._local:
@ -519,6 +517,8 @@ def update_online():
'id': settings.USER_ID,
'online': state.online
})
if state.online and state.nodes:
state.nodes.pull()
if settings.OLD_USER_ID and not settings.server.get('migrated_id', False):
from . import directory