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

Clear out all the ReadWrite transactions that are only necessary because of images #3504

Open
ikesau opened this issue Apr 16, 2024 · 1 comment

Comments

@ikesau
Copy link
Member

ikesau commented Apr 16, 2024

Grep // TODO: this transaction is only RW because somewhere inside it we fetch images and despair

Syncing images any time you touch them sounded nice, but it's turned out to be quite the anti-pattern.

#3496 updates loadGdocFromGdocBase so that we only write to the DB if contentSource=gdocs, but I think we need to go further and break that function into two.

A readwrite version, and a readonly version (which is all we need in most of the codebase, thereby clearing out all the TODO comments.)

It may be worth going even further and restructuring things so that the images table + S3 only update when an author hits publish, because we're kind of half-trying to do that, but it's not particularly consistent.

await updateGdocContentOnly(trx, id, gdoc)

@danyx23
Copy link
Contributor

danyx23 commented May 8, 2024

Probably makes sense to tackle this when we do #2485

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants