コード例 #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));
        }
コード例 #2
0
ファイル: EngineResolver.cs プロジェクト: zaawilli/FFDB
        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());
        }
コード例 #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());
        }