edit
This commit is contained in:
@@ -15,7 +15,15 @@ internal sealed class PdfStorageService
|
||||
_client = client;
|
||||
var options = configuration.GetSection("Crawler").Get<CrawlerOptions>()
|
||||
?? throw new InvalidOperationException("Раздел Crawler не найден в appsettings.json.");
|
||||
_rootPath = Environment.ExpandEnvironmentVariables(options.PdfStoragePath);
|
||||
var configuredPath = Environment.ExpandEnvironmentVariables(options.PdfStoragePath ?? string.Empty).Trim();
|
||||
if (string.IsNullOrWhiteSpace(configuredPath))
|
||||
{
|
||||
configuredPath = "PdfStore";
|
||||
}
|
||||
|
||||
_rootPath = Path.IsPathRooted(configuredPath)
|
||||
? configuredPath
|
||||
: Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, configuredPath));
|
||||
Directory.CreateDirectory(_rootPath);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user