dont print tasks by default

This commit is contained in:
j 2016-02-11 19:59:51 +05:30
parent 8a571a10a5
commit 146e64e2ae

View file

@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
import os
import json
from queue import PriorityQueue
from threading import Thread
import json
import os
import time
from websocket import trigger_event
import state
@ -12,6 +13,8 @@ import settings
import logging
logger = logging.getLogger(__name__)
DEUBG_TASKS = False
class Tasks(Thread):
_tasks = []
@ -37,7 +40,10 @@ class Tasks(Thread):
else:
try:
action, data = m
if DEUBG_TASKS:
t0 = time.time()
logger.debug('%s start', action)
if action == 'changelibrarypath':
item.scan.change_path(data[0], data[1])
elif action == 'export':
@ -60,7 +66,8 @@ class Tasks(Thread):
sync_metadata(data)
else:
trigger_event('error', {'error': 'unknown action'})
logger.debug('%s done', action)
if DEUBG_TASKS:
logger.debug('%s done (%s)', action, time.time()-t0)
except:
logger.debug('task failed', exc_info=True)
else: