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);
|
logger.Info("Loading Cardigann definitions from: " + path);
|
||||||
|
|
||||||
DirectoryInfo d = new DirectoryInfo(path);
|
try
|
||||||
|
|
||||||
foreach (var file in d.GetFiles("*.yml"))
|
|
||||||
{
|
{
|
||||||
string DefinitionString = File.ReadAllText(file.FullName);
|
DirectoryInfo d = new DirectoryInfo(path);
|
||||||
CardigannIndexer idx = new CardigannIndexer(this, container.Resolve<IWebClient>(), logger, container.Resolve<IProtectionService>(), DefinitionString);
|
|
||||||
if (indexers.ContainsKey(idx.ID))
|
foreach (var file in d.GetFiles("*.yml"))
|
||||||
{
|
{
|
||||||
logger.Debug(string.Format("Ignoring definition ID={0}, file={1}: Indexer already exists", idx.ID, file.FullName));
|
string DefinitionString = File.ReadAllText(file.FullName);
|
||||||
}
|
CardigannIndexer idx = new CardigannIndexer(this, container.Resolve<IWebClient>(), logger, container.Resolve<IProtectionService>(), DefinitionString);
|
||||||
else
|
if (indexers.ContainsKey(idx.ID))
|
||||||
{
|
{
|
||||||
indexers.Add(idx.ID, idx);
|
logger.Debug(string.Format("Ignoring definition ID={0}, file={1}: Indexer already exists", idx.ID, file.FullName));
|
||||||
LoadIndexerConfig(idx);
|
}
|
||||||
}
|
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