You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cli-repl): do not wait for connectionInfo in quiet non-REPL mode MONGOSH-1765 (#1962)
Do not wait for `fetchConnectionInfo()` and similar methods when they are
not needed. This hopefully improves startup performance in real-world
scenarios a bit further.
In order to achieve this:
- Implement a cache/lazy-loading ability for the connection info
in the shell-api `ShellInstanceState` class. We now only fetch
connection info here if requested, and only refresh it
if the service provider instance changed (and not just the
database itself).
- Adjust usage of the `fetchConnectionInfo()` method so that we
only wait for its result if we need it immediately.
This also adds type safety by removing the `any` typing for
`connectionInfo` in `ShellInstanceState`. I admittedly thought
that this would be a quick fix, but unfortunately (as seen in the
commit diff), this spiraled a bit into different packages and tests
as a larger change to align the typings for this object.
0 commit comments