Skip to content

Commit

Permalink
deduping
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyGaluzo committed Sep 24, 2023
1 parent efedb6b commit ae3ce94
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ internal class SqlServerFhirDataStore : IFhirDataStore, IProvideCapability
private readonly SchemaInformation _schemaInformation;
private readonly IModelInfoProvider _modelInfoProvider;
private static IgnoreInputLastUpdated _ignoreInputLastUpdated;
private static RawResourceDepuping _rawResourceDepuping;
private static RawResourceDeduping _rawResourceDeduping;
private static object _flagLocker = new object();

public SqlServerFhirDataStore(
Expand Down Expand Up @@ -97,11 +97,11 @@ public SqlServerFhirDataStore(
}
}

if (_rawResourceDepuping == null)
if (_rawResourceDeduping == null)
{
lock (_flagLocker)
{
_rawResourceDepuping ??= new RawResourceDepuping(_sqlRetryService, _logger);
_rawResourceDeduping ??= new RawResourceDeduping(_sqlRetryService, _logger);
}
}
}
Expand Down Expand Up @@ -516,7 +516,7 @@ private void ReplaceVersionIdAndLastUpdatedInMeta(ResourceWrapper resourceWrappe

private bool ExistingRawResourceIsEqualToInput(ResourceWrapper input, ResourceWrapper existing) // call is not symmetrical, it assumes version = 1 on input.
{
if (!_rawResourceDepuping.IsEnabled())
if (!_rawResourceDeduping.IsEnabled())
{
return false;
}
Expand Down Expand Up @@ -655,15 +655,15 @@ public bool IsEnabled()
}
}

private class RawResourceDepuping
private class RawResourceDeduping
{
private ISqlRetryService _sqlRetryService;
private readonly ILogger<SqlServerFhirDataStore> _logger;
private bool _isEnabled;
private DateTime? _lastUpdated;
private object _databaseAccessLocker = new object();

public RawResourceDepuping(ISqlRetryService sqlRetryService, ILogger<SqlServerFhirDataStore> logger)
public RawResourceDeduping(ISqlRetryService sqlRetryService, ILogger<SqlServerFhirDataStore> logger)
{
_sqlRetryService = sqlRetryService;
_logger = logger;
Expand Down

0 comments on commit ae3ce94

Please sign in to comment.