Commit 76d57289 authored by Cage, Gregory's avatar Cage, Gregory
Browse files

Add check to make sure tool is running before returning url

parent 3dbcb509
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -99,6 +99,6 @@ class Nova:
        yield conn
        # Remove all data stores after execution
        for store in conn.datastores:
            stop_all_tools_in_store(store)
            if not store.persist_store:
                stop_all_tools_in_store(store)
                conn.remove_data_store(store)
+4 −1
Original line number Diff line number Diff line
@@ -105,7 +105,10 @@ class Tool(AbstractWork):
            )
            for ep in entry_points.json():
                if ep["job_id"] == job_id and ep.get("target", None):
                    return f"{data_store.nova_connection.galaxy_url}{ep['target']}"
                    url = f"{data_store.nova_connection.galaxy_url}{ep['target']}"
                    response = galaxy_instance.make_get_request(url)
                    if response.status_code == 200:
                        return url
            timer -= 1
            time.sleep(1)
        status = galaxy_instance.jobs.cancel_job(job_id)