Permalink
Browse files

- Increasing default replication timeout to one minute

- Will reset failure count after first successful run
  • Loading branch information...
ayende committed May 22, 2012
1 parent 441cf77 commit 282ed69afc134e6613d00799af64bf5ef222ec02
Showing with 10 additions and 1 deletion.
  1. +10 −1 Bundles/Raven.Bundles.Replication/Tasks/ReplicationTask.cs
@@ -43,7 +43,8 @@ public void Execute(DocumentDatabase database)
{
docDb = database;
var replicationRequestTimeoutInMs =
- docDb.Configuration.GetConfigurationValue<int>("Raven/Replication/ReplicationRequestTimeout") ?? 7500;
+ docDb.Configuration.GetConfigurationValue<int>("Raven/Replication/ReplicationRequestTimeout") ??
+ 60*1000;
httpRavenRequestFactory = new HttpRavenRequestFactory { RequestTimeoutInMs = replicationRequestTimeoutInMs };
@@ -239,6 +240,7 @@ private bool ReplicateTo(ReplicationStrategy destination)
IncrementFailureCount(destination);
return false;
}
+ ResetFailureCount(destination);
return true;
}
@@ -261,6 +263,7 @@ private bool ReplicateTo(ReplicationStrategy destination)
IncrementFailureCount(destination);
return false;
}
+ ResetFailureCount(destination);
return true;
}
@@ -277,6 +280,12 @@ private void IncrementFailureCount(ReplicationStrategy destination)
RavenJObject.FromObject(failureInformation), new RavenJObject(), null);
}
+ private void ResetFailureCount(ReplicationStrategy destination)
+ {
+ docDb.Delete(ReplicationConstants.RavenReplicationDestinationsBasePath + EscapeDestinationName(destination), null,
+ null);
+ }
+
private bool IsFirstFailue(ReplicationStrategy destination)
{
var jsonDocument = docDb.Get(ReplicationConstants.RavenReplicationDestinationsBasePath + EscapeDestinationName(destination), null);

0 comments on commit 282ed69

Please sign in to comment.