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 local diagram files that are no longer used #50

Open
samwilson opened this issue Jan 11, 2022 · 6 comments
Open

Delete local diagram files that are no longer used #50

samwilson opened this issue Jan 11, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@samwilson
Copy link
Owner

Diagram images are rendered for every preview and page-save, and are never deleted. This means that diagram images will remain even if they're not in use anywhere on a wiki.

This does not apply when using the external rendering service.

@samwilson samwilson added the bug Something isn't working label Jan 11, 2022
@YOUR1
Copy link
Contributor

YOUR1 commented Aug 9, 2022

Is it not easier to write a maintenance script that removes all of the diagram images? They will be regenerated whenever a page is visited anyways..

@samwilson
Copy link
Owner Author

That would work for the default of having a diagrams/ subdirectory, but for #44 it'd have to be able to find the Diagrams files in amongst others. Perhaps it can already do that though, by looking for a pattern like Diagrams [0-9a-f]{32,32}\.[a-z]{2,5}?

It'd be slow on wikis with very many files, but perhaps that's okay. It wouldn't have to be run very often.

@YOUR1
Copy link
Contributor

YOUR1 commented Aug 10, 2022

I think you're missing a _ in the regex; but yes, I think that would do it.

samwilson added a commit that referenced this issue Jul 24, 2023
Add new maintenance script to delete diagram files older than one day.

Bug: #50
@samwilson
Copy link
Owner Author

I've got the maintenance script working now (PR #74). It can delete based on the age of the files: what would a good default be? I was thinking maybe 30 days. It can always be overridden with e.g. --ttl 90.

@YOUR1
Copy link
Contributor

YOUR1 commented Jul 27, 2023

I've got the maintenance script working now (PR #74). It can delete based on the age of the files: what would a good default be? I was thinking maybe 30 days. It can always be overridden with e.g. --ttl 90.

Nice, I think 30 is good for starters, its a wild guess tho.

samwilson added a commit that referenced this issue Jul 28, 2023
Add new maintenance script to delete diagram files older than 30 days.

Bug: #50
samwilson added a commit that referenced this issue Jul 28, 2023
Add new maintenance script to delete diagram files older than 30 days.

Bug: #50
@samwilson
Copy link
Owner Author

Done, and released as 0.12.0.

Can probably do more here, such as adding a page parser property that records which files are in use so they don't get deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants