Commit e6b80909 authored by Administrator's avatar Administrator

[FEATURE] Async feature for tests on server.

parent dcb9dfbe
......@@ -242,7 +242,8 @@ def project(request, project_id):
corpus.parse_resources()
# async
corpus.children.filter(type_id=type_document.pk).extract_ngrams(keys=['title',])
#corpus.children.filter(type_id=type_document.pk).extract_ngrams(keys=['title',])
#corpus.children.filter(type_id=type_document.pk).extract_ngrams(keys=['title',])
except Exception as error:
print(error)
......
......@@ -168,6 +168,7 @@ class Node(CTENode):
# mark the resources as parsed for this node
self.node_resource.update(parsed=True)
@current_app.task(filter=task_method)
def extract_ngrams(self, keys, ngramsextractorscache=None, ngramscaches=None):
# if there is no cache...
if ngramsextractorscache is None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment