mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-21 19:21:03 +02:00
Start/stop of processing is working
This commit is contained in:
parent
573f14e67b
commit
466e020e53
3 changed files with 20 additions and 11 deletions
|
|
@ -196,14 +196,14 @@ class Library:
|
|||
return {}
|
||||
|
||||
def start_processing(
|
||||
self, document_id, processing_id, flow="0000",
|
||||
self, id, document_id, flow="0000",
|
||||
user="trustgraph", collection="default", tags=[],
|
||||
):
|
||||
|
||||
input = {
|
||||
"operation": "add-processing",
|
||||
"processing-metadata": {
|
||||
"id": processing_id,
|
||||
"id": id,
|
||||
"document-id": document_id,
|
||||
"time": int(time.time()),
|
||||
"flow": flow,
|
||||
|
|
@ -218,12 +218,12 @@ class Library:
|
|||
return {}
|
||||
|
||||
def stop_processing(
|
||||
self, processing_id, user="trustgraph"
|
||||
self, id, user="trustgraph",
|
||||
):
|
||||
|
||||
input = {
|
||||
"operation": "remove-processing",
|
||||
"processing-id": processing_id,
|
||||
"processing-id": id,
|
||||
"user": user,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,15 +13,24 @@ default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
|||
default_user = "trustgraph"
|
||||
|
||||
def start_processing(
|
||||
url, user, document_id, processing_id, flow, collection, tags
|
||||
url, user, document_id, id, flow, collection, tags
|
||||
):
|
||||
|
||||
api = Api(url).library()
|
||||
|
||||
tags = tags.split(",")
|
||||
if tags:
|
||||
tags = tags.split(",")
|
||||
else:
|
||||
tags = []
|
||||
|
||||
api.start_processing(document_id, processing_id, flow, user,
|
||||
collection, tags)
|
||||
api.start_processing(
|
||||
id = id,
|
||||
document_id = document_id,
|
||||
flow = flow,
|
||||
user = user,
|
||||
collection = collection,
|
||||
tags = tags
|
||||
)
|
||||
|
||||
def main():
|
||||
|
||||
|
|
@ -49,7 +58,7 @@ def main():
|
|||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-d', '--did', '--document-id',
|
||||
'-d', '--document-id',
|
||||
required=True,
|
||||
help=f'Document ID',
|
||||
)
|
||||
|
|
@ -79,7 +88,7 @@ def main():
|
|||
url = args.api_url,
|
||||
user = args.user,
|
||||
document_id = args.document_id,
|
||||
processing_id = args.id,
|
||||
id = args.id,
|
||||
flow = args.flow_id,
|
||||
collection = args.collection,
|
||||
tags = args.tags
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ def stop_processing(
|
|||
|
||||
api = Api(url).library()
|
||||
|
||||
api.stop_processing(user, id)
|
||||
api.stop_processing(user = user, id = id)
|
||||
|
||||
def main():
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue