Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delayed job status #1102

Merged
merged 6 commits into from
Oct 16, 2024
Merged

Delayed job status #1102

merged 6 commits into from
Oct 16, 2024

Conversation

sdc50
Copy link
Member

@sdc50 sdc50 commented Oct 7, 2024

Description

Add the ability to add a query argument delay to the update_job_status callback, e.g.:

http://127.0.0.1:8000/update-job-status/14/?delay=120

The server will wait for delay seconds before calling update_status on the job.

Note:

This "delay" capability was added as a general capability, and the ability schedule periodic execution of a function was included (though not used by the update_job_status callback). I have not added this to the Tethys SDK because I would like to get more experience with it before deciding if it should be made "officially" available to apps. I don't consider it to be a robust task scheduling capability since all tasks are stored in memory and would be lost if the server restarts.

Changes Made to Code:

  • modified the update_job_status callback to be async and to support a delay
  • moved the job status views from tethys_apps to tethys_compute
  • migrated a few helper functions from tethys_gizmos to tethys_compute

Quality Checks

  • New code is 100% tested
  • Code has been formated
  • Code has been linted
  • Docstrings for new methods have been added

@coveralls
Copy link

coveralls commented Oct 7, 2024

Coverage Status

coverage: 100.0%. remained the same
when pulling e9e4ad2 on delayed_job_status
into 9121e14 on main.

@sdc50
Copy link
Member Author

sdc50 commented Oct 10, 2024

I'm not sure what happened to readthedocs, but our build there seems to be broken. I'm out of time to look into it for now.

@swainn
Copy link
Member

swainn commented Oct 11, 2024

I'm not sure what happened to readthedocs, but our build there seems to be broken. I'm out of time to look into it for now.

Best I can tell, what happened is Python 3.13 was released and the cgi module that Django 3.2 depended on was removed (previously deprecated). Our docs build was pinned to django=3.2.. I just updated it to 4.2. and the build worked.

@swainn swainn merged commit d4a8761 into main Oct 16, 2024
42 checks passed
@swainn swainn deleted the delayed_job_status branch October 16, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants