@@ -247,7 +247,7 @@ def post(self, request) -> PlainTextResponse:
247
247
# via thread to ensure the endpoint returns immediately
248
248
249
249
daemon .run (
250
- __add_parse_markdown_file_thread ,
250
+ CognitionParseMarkdownFile . __add_parse_markdown_file_thread ,
251
251
refinery_project_id ,
252
252
str (refinery_project_item .created_by ),
253
253
{
@@ -259,6 +259,18 @@ def post(self, request) -> PlainTextResponse:
259
259
260
260
return PlainTextResponse ("OK" )
261
261
262
+ def __add_parse_markdown_file_thread (
263
+ project_id : str , user_id : str , task_info : Dict [str , str ]
264
+ ):
265
+
266
+ ctx_token = general .get_ctx_token ()
267
+ try :
268
+ task_queue_manager .add_task (
269
+ project_id , TaskType .PARSE_MARKDOWN_FILE , user_id , task_info
270
+ )
271
+ finally :
272
+ general .remove_and_refresh_session (ctx_token , False )
273
+
262
274
263
275
class AssociationsImport (HTTPEndpoint ):
264
276
async def post (self , request ) -> JSONResponse :
@@ -481,16 +493,3 @@ def __calculate_missing_attributes(project_id: str, user_id: str) -> None:
481
493
message = "calculate_attribute:finished:all" ,
482
494
)
483
495
general .remove_and_refresh_session (ctx_token , False )
484
-
485
-
486
- def __add_parse_markdown_file_thread (
487
- project_id : str , user_id : str , task_info : Dict [str , str ]
488
- ):
489
-
490
- ctx_token = general .get_ctx_token ()
491
- try :
492
- task_queue_manager .add_task (
493
- project_id , TaskType .PARSE_MARKDOWN_FILE , user_id , task_info
494
- )
495
- finally :
496
- general .remove_and_refresh_session (ctx_token , False )
0 commit comments