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

AO3-5578 ActiveStorage copy script performance fixes #5015

Merged

Conversation

brianjaustin
Copy link
Member

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-5578

Purpose

Update the icon copy tasks to try to be nicer to the prod database (in particular the pseuds table).

@brianjaustin brianjaustin added the Priority: High - Broken on Test Merge immediately after approval label Jan 7, 2025
end

puts "Finished up to ID #{collection.id}" if collection.id.modulo(100).zero?
puts "Finished batch #{index + 1}"
Copy link
Contributor

@Bilka2 Bilka2 Jan 7, 2025

Choose a reason for hiding this comment

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

I think because you sleep right after, it would be good to have a $stdout.flush so that this definitely shows up in the output immediately.

And if you want to be fancy you can do the math for the total batch number that the other find_in_batches tasks do, but it's definitely not necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would not want to do the count for Pseud, it's large enough that I want to touch the table as little as possible (even things that are relatively safe)

Copy link
Contributor

@Bilka2 Bilka2 left a comment

Choose a reason for hiding this comment

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

🤞

@redsummernight redsummernight merged commit fb0d0cb into otwcode:master Jan 7, 2025
29 checks passed
slavalamp pushed a commit to slavalamp/otwarchive that referenced this pull request Jan 12, 2025
* AO3-5578 ActiveStorage copy script performance fixes

* Flush $stdout to force message visibility
brianjaustin added a commit that referenced this pull request Jan 22, 2025
)

* AO3-5502 correct page title on adult content warning chapters

* AO3-5502 add Cucumber test

* AO3-5502 satisfy Rubocop

* AO3-5578 ActiveStorage copy script performance fixes (#5015)

* AO3-5578 ActiveStorage copy script performance fixes

* Flush $stdout to force message visibility

* AO3-6873 Upgrade Elasticsearch for dev and automated tests (#5016)

* AO3-5578 Avoid unnecessary DB writes when copying icons (#5017)

* AO3-5578 Avoid unnecessary DB writes when copying icons

* Rubocop :fistshake:

* AO3-5578 Add a transaction to Psued image migration (#5018)

Add a transaction

* AO3-5578 Try to be nicer to the database when copying icons (#5019)

* Test listing in s3

* Other tasks & fixes

* Experiment with delayed upload

* Fixes

* Upload after txn

* Rubocop things

* Fixes

* Avoid duplicate attachments

* Revert "Avoid duplicate attachments"

This reverts commit 476bd02.

* AO3-5502 satisfy Rubocop again...?

* AO3-5502 satisfy more Rubocop

* AO3-5502 formatting improvements

* AO3-5502 make sure it's the adult notice page in the test

* AO3-5502 add another indent i forgot

---------

Co-authored-by: Brian Austin <[email protected]>
Co-authored-by: Bilka <[email protected]>
Co-authored-by: james_ <[email protected]>
@brianjaustin brianjaustin deleted the BOT-activestorage-scripts branch January 28, 2025 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants