Skip to content

Commit

Permalink
RavenDB-21993 - debug assert node tag for operations tracking in chan…
Browse files Browse the repository at this point in the history
…ges api
  • Loading branch information
lastav5 authored and arekpalinski committed May 17, 2024
1 parent 7a02829 commit c66f90a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Raven.Client/Documents/Changes/DatabaseChanges.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Net.Http;
using System.Threading.Tasks;
using Raven.Client.Documents.Operations;
Expand Down Expand Up @@ -59,6 +60,8 @@ internal IChangesObservable<AggressiveCacheChange> ForAggressiveCaching()

public IChangesObservable<OperationStatusChange> ForOperationId(long operationId)
{
Debug.Assert(string.IsNullOrEmpty(_nodeTag) == false, "Changes API must be provided a node tag in order to track node-specific operations.");

var counter = GetOrAddConnectionState("operations/" + operationId, "watch-operation", "unwatch-operation", operationId.ToString());

var taskedObservable = new ChangesObservable<OperationStatusChange, DatabaseConnectionState>(
Expand All @@ -70,6 +73,8 @@ public IChangesObservable<OperationStatusChange> ForOperationId(long operationId

public IChangesObservable<OperationStatusChange> ForAllOperations()
{
Debug.Assert(string.IsNullOrEmpty(_nodeTag) == false, "Changes API must be provided a node tag in order to track node-specific operations.");

var counter = GetOrAddConnectionState("all-operations", "watch-operations", "unwatch-operations", null);

var taskedObservable = new ChangesObservable<OperationStatusChange, DatabaseConnectionState>(
Expand Down

0 comments on commit c66f90a

Please sign in to comment.