Skip to content

Commit

Permalink
Fix missing await when doing upsert in DocumentFeedObserver.ProcessCh…
Browse files Browse the repository at this point in the history
…angesAsync.
  • Loading branch information
mkolt committed Jan 11, 2018
1 parent c636ff5 commit 7267a34
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions samples/ChangeFeedMigrationTool/DocumentFeedObserver.cs
Expand Up @@ -77,16 +77,14 @@ public Task CloseAsync(ChangeFeedObserverContext context, ChangeFeedObserverClos
/// <param name="context">The context specifying partition for this observer, etc.</param>
/// <param name="docs">The documents changed.</param>
/// <returns>A Task to allow asynchronous execution</returns>
public Task ProcessChangesAsync(ChangeFeedObserverContext context, IReadOnlyList<Document> docs)
public async Task ProcessChangesAsync(ChangeFeedObserverContext context, IReadOnlyList<Document> docs)
{
Console.WriteLine("Change feed: total {0} doc(s)", Interlocked.Add(ref totalDocs, docs.Count));
foreach (Document doc in docs)
{
Console.WriteLine(doc.Id.ToString());
this.client.UpsertDocumentAsync(this.destinationCollectionUri, doc);
await this.client.UpsertDocumentAsync(this.destinationCollectionUri, doc);
}

return Task.CompletedTask;
}
}
}

0 comments on commit 7267a34

Please sign in to comment.