[BI-2450]BrAPI Server DB connections exhausted on biapi startup caching #444
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BI-2450 - BrAPI Server DB connections exhausted on biapi startup caching
Description
The scheduled delay in creating the cache from the DOA's is now driven by the .env file. That way the expensive calls to the BrAPI server (that are called when bi-api is first started). can be staggered. The timing can be changed in a config file (.env), so that it can be fine tuned in each environment.
Testing
germplasm_start_delay=5s study_start_delay=10s trial_start_delay=15s trait_start_delay=20s observation_start_delay=25s observation_unit_start_delay=30s
2025-02-17 15:16:29.987-0500 [scheduled-executor-thread-1] DEBUG o.b.brapi.v2.dao.BrAPIGermplasmDAO - populating germplasm cache
2025-02-17 15:16:35.559-0500 [scheduled-executor-thread-3] DEBUG o.b.brapi.v2.dao.BrAPIStudyDAO - populating study cache
2025-02-17 15:16:40.548-0500 [scheduled-executor-thread-7] DEBUG o.b.b.v2.dao.impl.BrAPITrialDAOImpl - populating experiment cache
2025-02-17 15:16:50.548-0500 [scheduled-executor-thread-6] DEBUG o.b.brapi.v2.dao.BrAPIObservationDAO - populating observation cache
2025-02-17 15:16:55.551-0500 [scheduled-executor-thread-8] DEBUG o.b.b.v2.dao.BrAPIObservationUnitDAO - populating observation unit cache
Note: there is at least 5-seconds between each line.
Checklist: