Commit 74e867e0 authored by Cage, Gregory's avatar Cage, Gregory
Browse files

Read working directory from object store instead of hard coding it

parent 415567dd
Loading
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -646,8 +646,7 @@ class PulsarJobRunner(AsynchronousJobRunner):
            remote_metadata_directory = run_results.get("metadata_directory", None)
            stdout = run_results.get("stdout", "")
            if stdout == "":
                stdout_path = Path(".").parent.parent.parent.parent.parent / "database/jobs_directory/000" / str(
                    run_results["job_id"]) / "outputs/tool_stdout"
                stdout_path = Path(job_wrapper.working_directory) / "outputs" / "tool_stdout"
                stdout_file = open(stdout_path, "r")
                stdout = stdout_file.read()
            stderr = run_results.get("stderr", "")
+3 −3
Original line number Diff line number Diff line
@@ -238,11 +238,11 @@ class JobManager:
                    raise ItemAccessibilityException("You are not allowed to rerun this job.")
        trans.sa_session.refresh(job)

        # iF stdout_count and stdout_start_pos are good values, then load standard out and add it to status
        # If stdout_count and stdout_start_pos are good values, then load standard out and add it to status
        if job.state == job.states.RUNNING and stdout_count > 0 and stdout_start_pos > -1:
            try:
                stdout_path = Path(".").parent.parent.parent.parent.parent / "database/jobs_directory/000" / str(
                    job.id) / "outputs/tool_stdout"
                working_directory = trans.app.object_store.get_filename(job, base_dir="job_work", dir_only=True, obj_dir=True)
                stdout_path = Path(working_directory) / "outputs" / "tool_stdout"
                stdout_file = open(stdout_path, "r")
                stdout_file.seek(stdout_start_pos)
                job.job_stdout = stdout_file.read(stdout_count)