add peering task

This commit is contained in:
j 2016-01-14 17:52:39 +05:30
commit f6cfb255a6
2 changed files with 88 additions and 80 deletions

View file

@ -22,7 +22,7 @@ class Tasks(Thread):
def run(self):
import item.scan
from user.models import List
from user.models import export_list, update_user_peering
while self.connected:
m = self.q.get()
if m:
@ -33,9 +33,11 @@ class Tasks(Thread):
elif action == 'import':
item.scan.run_import(data)
elif action == 'export':
List.export(data)
export_list(data)
elif action == 'scan':
item.scan.run_scan()
elif action == 'peering':
update_user_peering(*data)
else:
trigger_event('error', {'error': 'unknown action'})
except: