Repository navigation
perf(cleanup): Optimize cleanup job - #9166
Conversation
41cd3d3 to
723e88c
Compare
723e88c to
0a05ff3
Compare
0a05ff3 to
ddad96c
Compare
|
@max-nextcloud @mejo- mates, please take a look on this |
|
I thought about this a bit more. The expensive task in the cleanup job is One solution would be to only do the attachments cleanup if the last saved timestamp is newer than the last attachment cleanup run for that document. To do this, we would have to add a What do you think about this approach @Koc @max-nextcloud @blizzz? |
Sound reasonable to me 馃憤 |
c8c1c87 to
4ddaeb5
Compare
4ddaeb5 to
c1759c6
Compare
mejo-
left a comment
There was a problem hiding this comment.
Looks great now. I pushed a small typo fix.
c1759c6 to
cf26231
Compare
cf26231 to
8541262
Compare
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
8541262 to
cb51bd1
Compare
|
@mejo- thank you, Jonas! I鈥檓 very appreciative of everything what you鈥檙e doing! 馃憦 |
馃摑 Summary
This is continuation of the #8421.
Problem:
The text app cleanup background job took roughly 800 seconds per run. The loop over documents with no active session unconditionally called
cleanupAttachments, even for documents that had unsaved changes and could not be reset. The same ~8,000 documents kept re-entering the cleanup loop every cron run, andcleanupAttachmentsis expensive because it resolves the file, reads Markdown content, scans the database, and iterates the attachment directory.Solution:
... 馃毀
Impact:
... 馃毀
馃弫 Checklist
npm run lint/npm run stylelint/composer run cs:check)馃 AI (if applicable)