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

feat: repair default icons job [DHIS2-18271] #18890

Merged
merged 3 commits into from
Oct 23, 2024
Merged

feat: repair default icons job [DHIS2-18271] #18890

merged 3 commits into from
Oct 23, 2024

Conversation

jbee
Copy link
Contributor

@jbee jbee commented Oct 22, 2024

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 and icon 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:

  • goto DHIS2_HOME /files/icons for the environment and remove some (or all) of the icon files
  • call PATCH /api/icons
  • check the deleted icons are restored (assuming they were default icons)

@jbee jbee self-assigned this Oct 22, 2024
@@ -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"));
Copy link
Contributor

@david-mackessy david-mackessy Oct 22, 2024

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?

Copy link
Contributor Author

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

Copy link

@jbee jbee merged commit e1ef244 into master Oct 23, 2024
15 checks passed
@jbee jbee deleted the DHIS2-18271 branch October 23, 2024 07:41
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.

3 participants