feat: require PathDB config in appsettings.json
This commit is contained in:
@@ -1601,7 +1601,7 @@ namespace URLNotesGrabberCORE
|
|||||||
|
|
||||||
public static void Initialize(IConfiguration config, string? dbPath, string configFilePath, string? overrideSection = null)
|
public static void Initialize(IConfiguration config, string? dbPath, string configFilePath, string? overrideSection = null)
|
||||||
{
|
{
|
||||||
_dbPath = dbPath ?? "..\\..\\..\\tl.db";
|
_dbPath = dbPath ?? throw new ArgumentNullException(nameof(dbPath));
|
||||||
_configFilePath = configFilePath;
|
_configFilePath = configFilePath;
|
||||||
EnsureStateTableExists();
|
EnsureStateTableExists();
|
||||||
|
|
||||||
|
|||||||
@@ -85,8 +85,8 @@ namespace URLNotesGrabberCORE
|
|||||||
args = filteredArgs.ToArray();
|
args = filteredArgs.ToArray();
|
||||||
|
|
||||||
string? dbPath = config["appSettings:PathDB"];
|
string? dbPath = config["appSettings:PathDB"];
|
||||||
if (string.IsNullOrWhiteSpace(dbPath))
|
if (string.IsNullOrEmpty(dbPath))
|
||||||
dbPath = Path.Combine(Directory.GetCurrentDirectory(), "..", "..", "..", "tl.db");
|
throw new InvalidOperationException("PathDB is not configured in appsettings.json");
|
||||||
|
|
||||||
ApiKeyPool.Initialize(config, dbPath, "appsettings.json", apiExplicitlySet ? apiSectionName : null);
|
ApiKeyPool.Initialize(config, dbPath, "appsettings.json", apiExplicitlySet ? apiSectionName : null);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user