only one scanimport

This commit is contained in:
j 2016-01-24 16:04:29 +05:30
parent cfb6913ef6
commit ac3dd595cf
2 changed files with 2 additions and 3 deletions

View file

@ -512,6 +512,7 @@ def publish_node():
state.check_nodes.start() state.check_nodes.start()
state._online = PeriodicCallback(update_online, 60000) state._online = PeriodicCallback(update_online, 60000)
state._online.start() state._online.start()
state.nodes.pull()
def update_online(): def update_online():
online = state.tor and state.tor.is_online() online = state.tor and state.tor.is_online()
@ -521,8 +522,6 @@ def update_online():
'id': settings.USER_ID, 'id': settings.USER_ID,
'online': state.online '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): if settings.OLD_USER_ID and not settings.server.get('migrated_id', False):
from . import directory from . import directory

View file

@ -155,8 +155,8 @@ def run():
state.main.call_later(10, publish) state.main.call_later(10, publish)
else: else:
nodes.publish_node() nodes.publish_node()
state.main.call_later(10, lambda: state.tasks.queue('scanimport'))
state.main.add_callback(publish) state.main.add_callback(publish)
state.main.call_later(10, lambda: state.tasks.queue('scanimport'))
if not state.update: if not state.update:
state.tasks = tasks.Tasks() state.tasks = tasks.Tasks()