public ReplicationAwareRequestExecuter(IDocumentStoreReplicationInformer replicationInformer, RequestTimeMetric requestTimeMetric) { this.replicationInformer = replicationInformer; this.requestTimeMetric = requestTimeMetric; }
public HttpJsonRequest AddReplicationStatusHeaders(string thePrimaryUrl, string currentUrl, IDocumentStoreReplicationInformer replicationInformer, FailoverBehavior failoverBehavior, Action <NameValueCollection, string, string> handleReplicationStatusChanges) { if (thePrimaryUrl.Equals(currentUrl, StringComparison.OrdinalIgnoreCase)) { return(this); } if (replicationInformer.GetFailureCount(thePrimaryUrl) <= 0) { return(this); // not because of failover, no need to do this. } var lastPrimaryCheck = replicationInformer.GetFailureLastCheck(thePrimaryUrl); headers.Set(Constants.RavenClientPrimaryServerUrl, ToRemoteUrl(thePrimaryUrl)); headers.Set(Constants.RavenClientPrimaryServerLastCheck, lastPrimaryCheck.ToString("s")); primaryUrl = thePrimaryUrl; operationUrl = currentUrl; HandleReplicationStatusChanges = handleReplicationStatusChanges; return(this); }
public ReplicationAwareRequestExecuter(IDocumentStoreReplicationInformer replicationInformer) { this.replicationInformer = replicationInformer; }