mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Gracefully fail on Cardigann definitions Exceptions (#595)
This commit is contained in:
@@ -74,21 +74,28 @@ namespace Jackett.Services
|
||||
{
|
||||
logger.Info("Loading Cardigann definitions from: " + path);
|
||||
|
||||
DirectoryInfo d = new DirectoryInfo(path);
|
||||
|
||||
foreach (var file in d.GetFiles("*.yml"))
|
||||
try
|
||||
{
|
||||
string DefinitionString = File.ReadAllText(file.FullName);
|
||||
CardigannIndexer idx = new CardigannIndexer(this, container.Resolve<IWebClient>(), logger, container.Resolve<IProtectionService>(), DefinitionString);
|
||||
if (indexers.ContainsKey(idx.ID))
|
||||
DirectoryInfo d = new DirectoryInfo(path);
|
||||
|
||||
foreach (var file in d.GetFiles("*.yml"))
|
||||
{
|
||||
logger.Debug(string.Format("Ignoring definition ID={0}, file={1}: Indexer already exists", idx.ID, file.FullName));
|
||||
}
|
||||
else
|
||||
{
|
||||
indexers.Add(idx.ID, idx);
|
||||
LoadIndexerConfig(idx);
|
||||
}
|
||||
string DefinitionString = File.ReadAllText(file.FullName);
|
||||
CardigannIndexer idx = new CardigannIndexer(this, container.Resolve<IWebClient>(), logger, container.Resolve<IProtectionService>(), DefinitionString);
|
||||
if (indexers.ContainsKey(idx.ID))
|
||||
{
|
||||
logger.Debug(string.Format("Ignoring definition ID={0}, file={1}: Indexer already exists", idx.ID, file.FullName));
|
||||
}
|
||||
else
|
||||
{
|
||||
indexers.Add(idx.ID, idx);
|
||||
LoadIndexerConfig(idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error(ex, "Error while loading Cardigann definitions: "+ ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user