diff --git a/src/Foundatio.Repositories.Elasticsearch/Jobs/CleanupIndexesJob.cs b/src/Foundatio.Repositories.Elasticsearch/Jobs/CleanupIndexesJob.cs index d41bb9e0..a4e610d8 100644 --- a/src/Foundatio.Repositories.Elasticsearch/Jobs/CleanupIndexesJob.cs +++ b/src/Foundatio.Repositories.Elasticsearch/Jobs/CleanupIndexesJob.cs @@ -29,7 +29,7 @@ public CleanupIndexesJob(IElasticClient client, ILockProvider lockProvider, Time { _client = client; _lockProvider = lockProvider; - _timeProvider = timeProvider; + _timeProvider = timeProvider ?? TimeProvider.System; _logger = loggerFactory?.CreateLogger(GetType()) ?? NullLogger.Instance; } diff --git a/src/Foundatio.Repositories.Elasticsearch/Jobs/SnapshotJob.cs b/src/Foundatio.Repositories.Elasticsearch/Jobs/SnapshotJob.cs index 096eaa95..9dd0c169 100644 --- a/src/Foundatio.Repositories.Elasticsearch/Jobs/SnapshotJob.cs +++ b/src/Foundatio.Repositories.Elasticsearch/Jobs/SnapshotJob.cs @@ -28,7 +28,7 @@ public SnapshotJob(IElasticClient client, ILockProvider lockProvider, TimeProvid { _client = client; _lockProvider = lockProvider; - _timeProvider = timeProvider; + _timeProvider = timeProvider ?? TimeProvider.System;; _logger = loggerFactory?.CreateLogger(GetType()) ?? NullLogger.Instance; }