Exemple #1
0
        /// <summary>
        /// Spin up local MongoDB instance if the user requested it.
        /// </summary>
        private LocalMongoProcessManager StartLocalMongoIfRequested(LogsharkRequest request)
        {
            if (!request.StartLocalMongo)
            {
                return(null);
            }

            // Start local Mongo instance.
            var processManager = new LocalMongoProcessManager(request.LocalMongoPort);

            processManager.StartMongoProcess(request.Configuration.LocalMongoOptions.PurgeLocalMongoOnStartup);

            // Update MongoConnectionInfo on the request to point to the local instance.
            request.Configuration.MongoConnectionInfo = processManager.GetConnectionInfo();

            return(processManager);
        }
Exemple #2
0
 public LocalMongoDatabaseManager(LogsharkRequest request)
 {
     localMongoProcessManager = StartLocalMongoIfRequested(request);
 }