Add task statistics logging every 15sec

This commit is contained in:
shortcutme 2019-03-15 23:29:04 +01:00
parent 74366379ba
commit 7ffb7db888
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -49,6 +49,13 @@ class WorkerManager(object):
continue continue
tasks = self.tasks[:] # Copy it so removing elements wont cause any problem tasks = self.tasks[:] # Copy it so removing elements wont cause any problem
num_tasks_started = len([task for task in tasks if task["time_started"]])
self.log.debug(
"Tasks: %s, started: %s, bad files: %s, total started: %s" %
(len(tasks), num_tasks_started, len(self.site.bad_files), self.started_task_num)
)
for task in tasks: for task in tasks:
if task["time_started"] and time.time() >= task["time_started"] + 60: if task["time_started"] and time.time() >= task["time_started"] + 60:
self.log.debug("Timeout, Skipping: %s" % task) # Task taking too long time, skip it self.log.debug("Timeout, Skipping: %s" % task) # Task taking too long time, skip it