-
Notifications
You must be signed in to change notification settings - Fork 354
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
feat: repair default icons job [DHIS2-18271] #18890
Conversation
@@ -121,7 +121,8 @@ public enum JobType { | |||
REMOVE_USED_OR_EXPIRED_RESERVED_VALUES( | |||
daily2am("uwWCT2BMmlq", "Remove expired or used reserved values")), | |||
SYSTEM_VERSION_UPDATE_CHECK( | |||
dailyRandomBetween3and5("vt21671bgno", "System version update check notification")); | |||
dailyRandomBetween3and5("vt21671bgno", "System version update check notification")), | |||
PHANTOM_ICON_REPAIR(every(10 * 60, "IconsRepair", "Phantom icon repair")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
every 10 mins seems a bit much.
We have ~400 default icons. So that'd be 400 file IO calls every 10 mins for something that seems like an issue we only ever see in Play because of the way we inefficiently tear down and bring instances back up (not a likely PRD scenario by the sounds of it).
This feels like everyone else is going to pay that price because of the way we setup our envs, which isn't great.
Would a once-off startup job/routine satisfy our needs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed I remove the job for now. We can always add it back in as a revert commit of 4f2fab8
Quality Gate passedIssues Measures |
Summary
Adds a new endpoint
PATCH /api/icons
(no body or parameters) to trigger repair of phantom default icons.These are icons that do exist in the DB tables as
fileresource
andicon
but their file content has gone missing.As the source images for these are in the jar file these then can be re-stored in the content store for the existing icon.
Automatic Testing
A new controller test was added
Manual Testing
For local disk storage backed file content store:
/files/icons
for the environment and remove some (or all) of the icon filesPATCH /api/icons