mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Don't call onListen more than once
eg, maybe the replset loses and regains its PRIMARY.
This commit is contained in:
@@ -243,10 +243,12 @@ exports.launchMongo = function (options) {
|
||||
var replSetReady = false;
|
||||
var replSetReadyToBeInitiated = false;
|
||||
var alreadyInitiatedReplSet = false;
|
||||
var alreadyCalledOnListen = false;
|
||||
var maybeCallOnListen = function () {
|
||||
if (listening && replSetReady) {
|
||||
if (listening && replSetReady && !alreadyCalledOnListen) {
|
||||
if (createReplSet)
|
||||
fs.writeFileSync(portFile, options.port);
|
||||
alreadyCalledOnListen = true;
|
||||
onListen();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user