Removed timelogging on metadata search

This commit is contained in:
Ozzie Isaacs 2021-08-29 14:37:15 +02:00
parent d1e6a85803
commit 4d92d7da3a

View File

@ -104,15 +104,11 @@ def metadata_search():
data = list() data = list()
active = current_user.view_settings.get('metadata', {}) active = current_user.view_settings.get('metadata', {})
if query: if query:
a = datetime.datetime.now()
static_cover = url_for('static', filename='generic_cover.jpg') static_cover = url_for('static', filename='generic_cover.jpg')
with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor: with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:
meta = {executor.submit(c.search, query, static_cover): c for c in cl if active.get(c.__id__, True)} meta = {executor.submit(c.search, query, static_cover): c for c in cl if active.get(c.__id__, True)}
for future in concurrent.futures.as_completed(meta): for future in concurrent.futures.as_completed(meta):
data.extend(future.result()) data.extend(future.result())
b = datetime.datetime.now()
c = b - a
log.info(c.total_seconds())
return Response(json.dumps(data), mimetype='application/json') return Response(json.dumps(data), mimetype='application/json')