Details
-
Improvement
-
Resolution: Won't Fix
-
Major - P3
-
None
-
None
-
None
-
Server Tooling & Methods
Description
The global "rs" and "sh" objects contain a variety of utility methods useful to users working at the shell command prompt, like sh.stopBalancer(). However, these utility methods often rely on the "db" global variable, making them difficult to use in scripts and tests. The "rs" and "sh" objects' methods should be refactored to delegate to methods that take the "db" object as an explicit parameter, and then tests and scripts could use those methods instead. This would eliminate the need for error-prone code like the following in tests and scripts:
var oldDb = db;
|
try {
|
db = // some other Database object
|
sh.stopBalancer()
|
}
|
finally {
|
db = oldDb;
|
}
|