sillsdev / languageforge-lexbox

Lexbox, SIL linguistic data hub
MIT License
7 stars 2 forks source link

gracefully handle mongodb not being avalible #1097

Closed hahn-kev closed 1 month ago

hahn-kev commented 1 month ago

closes #1092

right now if mongo is down or not accessible, then you can't access the project page. This PR introduces a circuit breaker with a fallback for the IsLanguageForgeProjectDataLoader ensuring that it never fails. If the circuit is broken, then we just return a result that says the project is not an LF project. The circuit will stay broken for 60 seconds before trying again (10 minutes in develop where it's expected to not come back up when not available)

I also introduced some configurable timeouts for mongo connections and reduced them to 1 second in develop and 5 seconds in production.

github-actions[bot] commented 1 month ago

C# Unit Tests

75 tests   75 :white_check_mark:  6s :stopwatch: 13 suites   0 :zzz:  1 files     0 :x:

Results for commit acc3756e.