From 1b5de8142fface85eb6d2de4fdbff9a41536968a Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 2 Dec 2024 15:50:50 -0600 Subject: Add UI to view status of the job as it runs. --- uploader/phenotypes/views.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'uploader/phenotypes') diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py index 79aab81..f23b377 100644 --- a/uploader/phenotypes/views.py +++ b/uploader/phenotypes/views.py @@ -366,3 +366,30 @@ def add_phenotypes(species: dict, population: dict, dataset: dict, **kwargs):# p # f"{app.config['UPLOAD_FOLDER']}/job_errors") raise NotImplementedError("Please implement this...") + + +@phenotypesbp.route( + "/populations//phenotypes/datasets" + "//job/", + methods=["GET"]) +@require_login +@with_dataset( + species_redirect_uri="species.populations.phenotypes.index", + population_redirect_uri="species.populations.phenotypes.select_population", + redirect_uri="species.populations.phenotypes.list_datasets") +def job_status(species: dict, population: dict, dataset: dict, job_id: uuid, **kwargs): + """Retrieve current status of a particular phenotype QC job.""" + from uploader.debug import __pk__ + + with Redis.from_url(app.config["REDIS_URL"], decode_responses=True) as rconn: + try: + job = jobs.job(rconn, jobs.jobsnamespace(), str(job_id)) + except jobs.JobNotFound as _jnf: + job = None + return render_template("phenotypes/job-status.html", + species=species, + population=population, + dataset=dataset, + job_id=job_id, + job=job, + activelink="add-phenotypes") -- cgit v1.2.3