mirror of
https://github.com/xboxeer/NScrapy.git
synced 2026-10-29 12:39:57 +08:00
Create a ConifgProviderFactory so thay we can get ConfigProvider from a single point Also enhenced the logic of refresh config, right now when zookeeper watcher dected the config is changed NScrapy will update its context, and during that time, NScrapy will lock the access to the Connection of Redis
22 lines
632 B
C#
22 lines
632 B
C#
using Microsoft.Extensions.Configuration;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
|
|
namespace NScrapy.Infra.ConfigProvider
|
|
{
|
|
/// <summary>
|
|
/// Default Config provider is called by defualt by NScrapyContext or DownloaderContext
|
|
/// It will look for other ConfigProvider if they are defined in default config appsetting.json
|
|
/// </summary>
|
|
public class DefaultConfigProvider : IConfigProvider
|
|
{
|
|
public string GetConfigFilePath()
|
|
{
|
|
return ConfigProviderFactory.DEFAULTCONFIG;
|
|
}
|
|
}
|
|
} |