@@ -247,7 +247,7 @@ def post(self, request) -> PlainTextResponse:
247247 # via thread to ensure the endpoint returns immediately
248248
249249 daemon .run (
250- __add_parse_markdown_file_thread ,
250+ CognitionParseMarkdownFile . __add_parse_markdown_file_thread ,
251251 refinery_project_id ,
252252 str (refinery_project_item .created_by ),
253253 {
@@ -259,6 +259,18 @@ def post(self, request) -> PlainTextResponse:
259259
260260 return PlainTextResponse ("OK" )
261261
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+
262274
263275class AssociationsImport (HTTPEndpoint ):
264276 async def post (self , request ) -> JSONResponse :
@@ -481,16 +493,3 @@ def __calculate_missing_attributes(project_id: str, user_id: str) -> None:
481493 message = "calculate_attribute:finished:all" ,
482494 )
483495 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