-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure asset update happens at least once
The `CreateAssetWorker` relies on the `DraftUpdaterWorker` successfully running in order to trigger a call to the `MetadataWorker` for editionable attachables. This happens due to the `AttachmentUpdater` service listening on the edition `draft_update` event. However, if the edition is not valid, e.g. the attachment has been updated/replaced before saving the edition with a change note, then the `DraftUpdaterWorker` will not run, and the MetadataWorker will not be triggered. This means the state of the asset in Asset Manager will not be updated. There are additional attempts that try to achieve the same result, that also fail: - The `save_attachment` method in the `AttachmentsController` calls the `draft_updater`, which again fails, as above, because the edition is invalid, causing the `MetadataWorker` to not be enqueued. - Although the `attachment_updater` in the `AttachmentsController` also triggers the MetadataWorker, it typically fails because the assets are not yet ready. There is currently no retry mechanism in place for this worker. The current change ensures that the `MetadataWorker` runs after the asset has been created irrespective of whether or not the edition is valid. This ensures that we send an update to Asset Manager.
- Loading branch information
1 parent
65d4b0d
commit 7401c90
Showing
3 changed files
with
81 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters