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

Add limited 'global statement' functionality (inefficient) #6

Merged
merged 4 commits into from
Oct 19, 2023

Conversation

kevinsogo
Copy link
Collaborator

No changes to the DB were made here, so I had to use a hacky way of checking whether there is a global statement: Literally check that all tasks have exactly the same .pdf statements!

Luckily, CMS already caches files, so if two files are exactly the same, then they are stored as the same file object in the DB, and we can just compare digests instead of the full files.

Note that there's some inefficiency here since many requests will now call the get_global_statements function which fetches several objects from the DB just to compute whether there's a global statement.

@kevinsogo
Copy link
Collaborator Author

Please "Squash and merge" this when you merge. Thanks

@kevinsogo
Copy link
Collaborator Author

When you merge this, please merge the "noi" branch into the "noitama" branch. Thanks

@kevinsogo
Copy link
Collaborator Author

Okay after discussion with @jabbawookiees , I initially considered adding caching to get_global_statements, pero tingin ko wag na. I'm planning on overhauling this naman by Abakoda with a more proper implementation that actually touches the DB. Maganda na rin itong trial run to know how well the server will be able to handle the TAMa load, haha

@kevinsogo kevinsogo merged commit 0e6d3e2 into noi-ph:noi Oct 19, 2023
1 check passed
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.

2 participants