Exemplo n.º 1
0
        private static FfdbEngine FOR_DOCS()
        {
            var setup = new EngineSetup();

            setup
            .SetRootDataDirectoryPath(@"C:\path\to\data\dir\")
            .UseMongo(new MongoConfig
            {
                ConnectionString = "connection_string",
                DatabaseName     = "db_name"
            });

            FfdbEngine engine = setup.Create();

            return(GetConfiguredEngine(setup));
        }
Exemplo n.º 2
0
        internal static FfdbEngine Resolve(FfdbConfig config, RunInfoBase runInfo, DataRepoState dataRepoState)
        {
            var setup = new EngineSetup()
                        .SetRootDataDirectoryPath(config.RootDataPath)
                        .ConfigureWebClient(config)
                        .ConfigureLogging(config)
                        .ConfigureDbProvider(config)
                        .ConfigureFromRunInfo(runInfo);

            bool fetchFromDataRepo = dataRepoState?.Enabled ?? false;

            if (fetchFromDataRepo)
            {
                setup.EnableFetchingFromDataRepo();
            }

            return(setup.Create());
        }
Exemplo n.º 3
0
        private static FfdbEngine GetConfiguredEngine(EngineSetup setup)
        {
            setup
            .SetRootDataDirectoryPath(@"D:\Repos\ffdb_data_5\");
            //.SetRootDataDirectoryPath(@"D:\Repos\FFDB.Data\");

            setup.WebRequest
            .SetThrottle(3000)
            .AddDefaultBrowserHeaders();

            setup.Logging
            .SetLogDirectory(@"D:\Repos\ffdb_logs\")
            .SetRollingInterval(RollingInterval.Day)
            .UseDebugLogLevel();

            setup
            .SkipRosterFetch()
            .SaveToDisk()
            .SaveOriginalSourceFiles()
            .EnableFetchingFromDataRepo();

            return(setup.Create());
        }