ec-jrc / re3gistry

Re3gistry is a reusable open source solution for managing and sharing ‘reference codes’, ensuring semantic interoperability across organisations.
European Union Public License 1.2
29 stars 23 forks source link

Question on CacheAll and languages #108

Closed heidivanparys closed 2 years ago

heidivanparys commented 2 years ago

In the following code:

https://github.com/ec-jrc/re3gistry/blob/79f806053066cfa1fb1636ce34b64912004ccb32/sources/Re3gistry2RestAPI/src/main/java/eu/europa/ec/re3gistry2/restapi/CacheAllServlet.java#L69-L86

why is languageManager.getAll() used and not languageManager.getAllActive()?

This process seems to take quite some time (20 minutes for our test installation with a limited amount of data), so only caching the active languages (in our installation, we only have two active languages) could help to speed it up? Avoid unnecessary queries to the database?

emanuelaepure10 commented 2 years ago

Indead, that's a perfect question. I completely agree that languageManager.getAllActive() is the method to be called.

Thank you for reporting it.

emanuelaepure10 commented 2 years ago

https://github.com/ec-jrc/re3gistry/commit/90fa0c1fb1468d6d9ee28d5530a5fbc02408cc7e