@@ -518,10 +518,12 @@ def get_logs_for_unit(pioreactor_unit: str) -> ResponseReturnValue:
518518
519519
520520@api .route ("/workers/<pioreactor_unit>/experiments/<experiment>/logs" , methods = ["POST" ])
521+ @api .route ("/units/<pioreactor_unit>/experiments/<experiment>/logs" , methods = ["POST" ])
521522def publish_new_log (pioreactor_unit : str , experiment : str ) -> ResponseReturnValue :
522523 body = request .get_json ()
524+ source_ = body .get ("source_" , "ui" )
523525
524- topic = f"pioreactor/{ pioreactor_unit } /{ experiment } /logs/ui /{ body ['level' ].lower ()} "
526+ topic = f"pioreactor/{ pioreactor_unit } /{ experiment } /logs/{ source_ } /{ body ['level' ].lower ()} "
525527 client .publish (
526528 topic ,
527529 msg_to_JSON (
@@ -1275,14 +1277,14 @@ def export_datasets() -> ResponseReturnValue:
12751277 "--output" , filename_with_path .as_posix (), * cmd_tables , * experiment_options , * other_options
12761278 )
12771279 try :
1278- status = result (blocking = True , timeout = 5 * 60 )
1280+ status , msg = result (blocking = True , timeout = 5 * 60 )
12791281 except (HueyException , TaskException ):
12801282 status = False
12811283 return {"result" : status , "filename" : None , "msg" : "Timed out" }, 500
12821284
12831285 if not status :
1284- publish_to_error_log ("Failed." , "export_datasets" )
1285- return {"result" : status , "filename" : None , "msg" : "Failed." }, 500
1286+ publish_to_error_log (msg , "export_datasets" )
1287+ return {"result" : status , "filename" : None , "msg" : msg }, 500
12861288
12871289 return {"result" : status , "filename" : filename , "msg" : "Finished" }, 200
12881290
0 commit comments