Commit 88e7e94c authored by Cage, Gregory's avatar Cage, Gregory
Browse files

Merge branch 'speedup-recover-tools' into 'main'

Speed up recovering tools by reducing http calls

See merge request ndip/public-packages/nova-galaxy!14
parents 5f39ecc0 d37b69d0
Loading
Loading
Loading
Loading
Loading
+89 −85

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
[tool.poetry]
name = "nova-galaxy"
version = "0.7.0"
version = "0.7.1"
description = "Utilties for accessing the ORNL Galaxy instance"
authors = ["Greg Watson <watsongr@ornl.gov>", "Gregory Cage <cagege@ornl.gov>"]
readme = "README.md"
+13 −12
Original line number Diff line number Diff line
@@ -43,18 +43,19 @@ class Datastore:
        -------
            List of tools from this data store.
        """
        history_contents = self.nova_connection.galaxy_instance.histories.show_history(
            self.history_id, contents=True, deleted=False, details="all"
        if filter_running:
            states = ["running", "queued"]
        else:
            states = ["running", "queued", "ok", "error"]
        jobs = self.nova_connection.galaxy_instance.jobs.get_jobs(
            state=states,  # type: ignore
            history_id=self.history_id,
        )
        tools = []
        for dataset in history_contents:
            job_id = dataset.get("creating_job", None)
            if job_id:
                info = self.nova_connection.galaxy_instance.jobs.show_job(job_id)
                if info["state"] == "running" or info["state"] == "queued" or not filter_running:
                    tool_id = info["tool_id"]
        for job in jobs:
            job_id = job["id"]
            tool_id = job["tool_id"]
            t = Tool(tool_id)
            t.assign_id(job_id, self)
                    t.get_url(max_tries=1)
            tools.append(t)
        return tools
+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

+1 −1

File changed.

Contains only whitespace changes.

Loading