diff options
author | Dan Pasette <dan@10mongodb.com> | 2014-03-17 20:15:56 -0400 |
---|---|---|
committer | Dan Pasette <dan@mongodb.com> | 2014-03-17 20:15:56 -0400 |
commit | be2d871df615e8322c5cb377426721e171830ed4 (patch) | |
tree | 082f627fd5c51c19698c5b3bcb6646e5e22e7b99 | |
parent | c991426e46e416dfad3e433995a1bd2725e9b09c (diff) | |
download | mongo-be2d871df615e8322c5cb377426721e171830ed4.tar.gz |
Revert "SERVER-13033: Fix bad static initializer"
This reverts commit c991426e46e416dfad3e433995a1bd2725e9b09c.
-rw-r--r-- | src/mongo/scripting/engine.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/mongo/scripting/engine.cpp b/src/mongo/scripting/engine.cpp index 694b12ae94f..e6bb8be819e 100644 --- a/src/mongo/scripting/engine.cpp +++ b/src/mongo/scripting/engine.cpp @@ -22,8 +22,6 @@ #include <cctype> #include <boost/filesystem/operations.hpp> -#include "mongo/base/init.h" -#include "mongo/base/initializer.h" #include "mongo/client/dbclientcursor.h" #include "mongo/client/dbclientinterface.h" #include "mongo/scripting/bench.h" @@ -32,7 +30,6 @@ namespace mongo { long long Scope::_lastVersion = 1; static const unsigned kMaxJsFileLength = std::numeric_limits<unsigned>::max() - 1; - static DBClientBase* directDBclient; ScriptEngine::ScriptEngine() : _scopeInitCallback() { } @@ -160,14 +157,6 @@ namespace mongo { uassert(10430, "invalid object id: not hex", std::isxdigit(str.at(i))); } - MONGO_INITIALIZER(CreateJSDirectClient) - (InitializerContext* context) { - - directDBclient = createDirectClient(); - - return Status::OK(); - } - void Scope::loadStored(bool ignoreNotConnected) { if (_localDBName.size() == 0) { if (ignoreNotConnected) @@ -181,8 +170,8 @@ namespace mongo { _loadedVersion = _lastVersion; string coll = _localDBName + ".system.js"; - auto_ptr<DBClientCursor> c = directDBclient->query(coll, Query(), 0, 0, NULL, - QueryOption_SlaveOk, 0); + static DBClientBase* db = createDirectClient(); + auto_ptr<DBClientCursor> c = db->query(coll, Query(), 0, 0, NULL, QueryOption_SlaveOk, 0); massert(16669, "unable to get db client cursor from query", c.get()); set<string> thisTime; |