-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve title resolution; make it a background process #1006
Comments
For now, it is probably fine to put title resolution errors within the DeltaResolvedTitleError model. In the future, we may want to integrate it with the broader notifications/logs system that has been proposed. |
Demo
Background_Title_Resolution.mov |
Tests failing (Fixed Now)
def apply(self) -> None:
# Inserting here to avoid circular import issue
from ..tasks import process_title_resolutions
def queue_task():
process_title_resolutions.delay(self.id)
# Queue the background task only after the transaction commits (i.e, after apply() method)
transaction.on_commit(queue_task)
Methods Tried
@pytest.mark.django_db(transaction=True)
class TestDeltaTitlePattern(TransactionTestCase):
@pytest.mark.django_db(transaction=True)
def test_apply_generates_delta_url_if_title_differs(self):
# Call the `apply()` method and capture/execute `on_commit` callbacks
with self.captureOnCommitCallbacks(execute=True): # Ensure `on_commit` callbacks are executed
pattern.apply() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Right now title resolution is a foreground process that is long-running and can possibly time out. We want to defer this to the background and have a mechanism to track when it succeeds/fails.
Implementation Considerations
Deliverable
Dependencies
No response
The text was updated successfully, but these errors were encountered: