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

Delete attachment async when the admin status API is triggered #63

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

bakulf
Copy link

@bakulf bakulf commented Feb 22, 2024

No description provided.

@bakulf bakulf requested review from aaga and toufali February 22, 2024 16:42
@bakulf bakulf merged commit 63a5f52 into main Feb 22, 2024
43 of 62 checks passed
Copy link

@aaga aaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one extra change needed but otherwise LGTM

@@ -28,7 +28,7 @@ def destroy
if @status.with_media?
# Immediately remove public copy of media instead of waiting for
# the vacuum_orphaned_records job to take care of it later on
Admin::MediaAttachmentDeletionWorker.perform_inline(@status.media_attachments)
Admin::MediaAttachmentDeletionWorker.perform_async(@status.media_attachments.map(&:id))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same change needs to be made in status_batch_action.rb

btw do we know how soon is the expected execution of a perform_async task? It should not be later than a couple minutes (if e.g. we need to take down a particularly egregious piece of media)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow up for the fix!

About the timing, it's just an async call. Locally it's triggered after less than 1 second.

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