Skip to content

Commit a39c1f9

Browse files
committed
Chagned data type and ensure it's cleaned up
1 parent 88de360 commit a39c1f9

File tree

1 file changed

+7
-1
lines changed
  • src/Foundatio.Repositories.Elasticsearch/Configuration

1 file changed

+7
-1
lines changed

src/Foundatio.Repositories.Elasticsearch/Configuration/DailyIndex.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class DailyIndex : VersionedIndex
3131
private TimeSpan? _maxIndexAge;
3232
protected readonly Func<object, DateTime> _getDocumentDateUtc;
3333
protected readonly string[] _defaultIndexes;
34-
private readonly ConcurrentDictionary<DateTime, object> _ensuredDates = new();
34+
private readonly ConcurrentDictionary<DateTime, string> _ensuredDates = new();
3535

3636
public DailyIndex(IElasticConfiguration configuration, string name, int version = 1, Func<object, DateTime> getDocumentDateUtc = null)
3737
: base(configuration, name, version)
@@ -501,6 +501,12 @@ public override Task EnsureIndexAsync(object target)
501501
return EnsureDateIndexAsync(date);
502502
}
503503

504+
public override void Dispose()
505+
{
506+
_ensuredDates.Clear();
507+
base.Dispose();
508+
}
509+
504510
[DebuggerDisplay("Name: {Name} Max Age: {MaxAge}")]
505511
public class IndexAliasAge
506512
{

0 commit comments

Comments
 (0)