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

OA-40: Add property to control starting of the module #24

Merged
merged 4 commits into from
Dec 3, 2024

Conversation

corneliouzbett
Copy link
Member

Issue: https://openmrs.atlassian.net/browse/OA-40

This PR adds property oauth2.enabled to control starting of the module. It defaults to true to ensure backward compatibility if the property is not set.

Copy link
Member

@wluyima wluyima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have left 2 comments

@ibacher
Copy link
Member

ibacher commented Dec 2, 2024

Two high-level comments:

  1. This is... very clever, and I get the "cleanliness" of simply stopping and unloading the module. This is maybe something we could consider adding in core as part of a shouldStart callback in the activator?
  2. Stopping a module is potentially a very costly operation. This is because it can trigger a context refresh on trying to unload the module. All that is meant to suggest that this is probably fine in this limited case, but this would be a very bad pattern to adopt globally (hence my suggestion of building the functionality into core, since we can, at the very least, batch all the modules that were loaded but shouldn't start into a single context refresh).

Copy link
Member

@wluyima wluyima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some nitpick comments, but this is approved to be merged

@corneliouzbett
Copy link
Member Author

Two high-level comments:

  1. This is... very clever, and I get the "cleanliness" of simply stopping and unloading the module. This is maybe something we could consider adding in core as part of a shouldStart callback in the activator?
  2. Stopping a module is potentially a very costly operation. This is because it can trigger a context refresh on trying to unload the module. All that is meant to suggest that this is probably fine in this limited case, but this would be a very bad pattern to adopt globally (hence my suggestion of building the functionality into core, since we can, at the very least, batch all the modules that were loaded but shouldn't start into a single context refresh).

Thank you @ibacher for the insightful comments. Your comments makes sense to me. I will create a TRUNK ticket to further evaluate the possibility of incorporating this functionality into the core.

@corneliouzbett corneliouzbett merged commit 548f1d9 into master Dec 3, 2024
1 check passed
@corneliouzbett corneliouzbett deleted the OA-40 branch December 3, 2024 08:22
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