Skip to content

Commit

Permalink
Fixes issue #27
Browse files Browse the repository at this point in the history
  • Loading branch information
ryannewington committed May 18, 2018
1 parent 8a123aa commit 52faff0
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/Lithnet.Acma.Service/AcmaSyncService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void ExportEnd()
{
Logger.WriteLine("Export Complete");
Logger.WriteSeparatorLine('*');

MAStatistics.StopOperation();
Logger.WriteLine(MAStatistics.ToString());
}
Expand Down Expand Up @@ -125,22 +125,28 @@ public ImportResponse ImportStart(ImportStartRequest request)
CachedImportRequest cachedRequest = new CachedImportRequest();
cachedRequest.Request = request;

if (cachedRequest.Request.ImportType == OperationType.Delta)
{
this.ProcessOperationEvents(AcmaEventOperationType.DeltaImport);
}
else
{
this.ProcessOperationEvents(AcmaEventOperationType.FullImport);
}

byte[] watermark = ActiveConfig.DB.GetHighWatermarkMAObjectsDelta();
response.Watermark = watermark == null ? null : Convert.ToBase64String(watermark);
cachedRequest.HighWatermark = watermark;

Logger.WriteLine("Got delta watermark: {0}", response.Watermark);

ResultEnumerator enumerator;

if (cachedRequest.Request.ImportType == OperationType.Delta)
{
this.ProcessOperationEvents(AcmaEventOperationType.DeltaImport);
enumerator = ActiveConfig.DB.EnumerateMAObjectsDelta(watermark);
}
else
{
this.ProcessOperationEvents(AcmaEventOperationType.FullImport);
enumerator = ActiveConfig.DB.EnumerateMAObjects(cachedRequest.Request.Schema.Types.Select(t => t.Name).ToList(), null, null);
}

Expand Down

0 comments on commit 52faff0

Please sign in to comment.