Skip to content

Commit 2485642

Browse files
committed
fix refresh
1 parent 258fcce commit 2485642

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

‎Rdmp.Core/Databases/CatalogueDatabase/up/094_EnableTrackedChanges.sql‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ IF NOT EXISTS (SELECT 1 FROM sys.change_tracking_tables WHERE object_id = OBJECT
1313
IF NOT EXISTS (SELECT 1 FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID('RegexRedaction'))
1414
ALTER TABLE RegexRedaction ENABLE CHANGE_TRACKING
1515
IF NOT EXISTS (SELECT 1 FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID('RegexRedactionKey'))
16-
ALTER TABLE RegexRedactionKey ENABLE CHANGE_TRACKING
16+
ALTER TABLE RegexRedactionKey ENABLE CHANGE_TRACKING
17+
IF NOT EXISTS (SELECT 1 FROM sys.change_tracking_tables WHERE object_id = OBJECT_ID('Commit'))
18+
ALTER TABLE [Commit] ENABLE CHANGE_TRACKING

‎Rdmp.Core/Providers/CatalogueChildProvider.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,7 +1809,7 @@ public bool SelectiveRefresh(AggregateFilterContainer container)
18091809
return true;
18101810
}
18111811

1812-
private void FullReloadAsync(ICatalogueRepository repository)
1812+
protected void FullReloadAsync(ICatalogueRepository repository)
18131813
{
18141814
_commentStore = repository.CommentStore;
18151815
_catalogueRepository?.EncryptionManager?.ClearAllInjections();
@@ -1822,7 +1822,7 @@ private void FullReloadAsync(ICatalogueRepository repository)
18221822

18231823
// all the objects which are
18241824
AllMasqueraders = new ConcurrentDictionary<object, HashSet<IMasqueradeAs>>();
1825-
1825+
_pluginChildProviders = Array.Empty<IChildProvider>();
18261826
ReportProgress("Before object fetches");
18271827

18281828
AllAnyTableParameters = GetAllObjects<AnyTableSqlParameter>(repository);

‎Rdmp.Core/Providers/DataExportChildProvider.cs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public DataExportChildProvider(IRDMPPlatformRepositoryServiceLocator repositoryL
125125
ForbidListedSources = previousStateIfKnown?.ForbidListedSources ?? new List<ExternalCohortTable>();
126126
_errorsCheckNotifier = errorsCheckNotifier;
127127
dataExportRepository = repositoryLocator.DataExportRepository;
128+
base.FullReloadAsync(repositoryLocator.CatalogueRepository);
128129
FullReloadAsync(dataExportRepository);
129130
}
130131

@@ -831,6 +832,7 @@ public bool SelectiveRefresh(IExtractionConfiguration ec)
831832

832833
private void FullReloadAsync(IDataExportRepository repository)
833834
{
835+
base.FullReloadAsync(repository.CatalogueRepository);
834836
AllProjectAssociatedCics =
835837
GetAllObjects<ProjectCohortIdentificationConfigurationAssociation>(dataExportRepository);
836838

@@ -968,6 +970,9 @@ protected override void RebuildPipelineTree()
968970

969971
public override async Task RefreshAsync(CancellationToken ct = default)
970972
{
973+
// Delegate to base so that Catalogue-side tracked tables are also patched.
974+
await base.RefreshAsync(ct);
975+
971976
if (_changeTracking is null)
972977
{
973978
FullReloadAsync(dataExportRepository);
@@ -1126,8 +1131,7 @@ public override async Task RefreshAsync(CancellationToken ct = default)
11261131

11271132
_lastSeenVersion = changes.CurrentVersion;
11281133

1129-
// Delegate to base so that Catalogue-side tracked tables are also patched.
1130-
await base.RefreshAsync(ct);
1134+
11311135
}
11321136

11331137
}

0 commit comments

Comments
 (0)