Skip to content

Commit

Permalink
missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
Shazwazza committed Jul 14, 2020
1 parent aecea6b commit da998e9
Showing 1 changed file with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using System.Security;
using Lucene.Net.Index;


namespace Examine.LuceneEngine.Providers
{
/// <summary>
/// Used to prevent the appdomain from crashing when lucene runs into a concurrent merge scheduler failure
/// </summary>
[SecurityCritical]
internal class ErrorLoggingConcurrentMergeScheduler : ConcurrentMergeScheduler
{
private readonly Action<string, Exception> _logger;

[SecurityCritical]
public ErrorLoggingConcurrentMergeScheduler(string indexName, Action<string, Exception> logger)
{
IndexName = indexName;
_logger = logger;
}

public string IndexName { get; }

[SecurityCritical]
protected override void HandleMergeException(System.Exception exc)
{
try
{
base.HandleMergeException(exc);
}
catch (Exception e)
{
_logger($"Concurrent merge failed for index: {IndexName} if this error is persistent then index rebuilding is necessary", e);
}
}
}
}

0 comments on commit da998e9

Please sign in to comment.