Skip to content

Commit

Permalink
RavenDB-5680 Fixing an issue where MoreLikeThis will take too long to…
Browse files Browse the repository at this point in the history
… get the stats and the request will timeout
  • Loading branch information
talweiss1982 authored and ayende committed Nov 24, 2016
1 parent 95ad2e6 commit 332d39b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
Expand Up @@ -271,6 +271,7 @@ public async Task<HttpResponseMessage> IndexHasChanged()
public async Task<HttpResponseMessage> MoreLikeThis()
{
var key = Guid.NewGuid().ToString();
DocumentStore.DatabaseCommands.GetStatistics();
await DocumentStore.AsyncDatabaseCommands.PutAsync(key, null, new RavenJObject(), new RavenJObject());

SpinWait.SpinUntil(() => DocumentStore.DatabaseCommands.GetStatistics().StaleIndexes.Length == 0);
Expand Down
Expand Up @@ -270,6 +270,7 @@ public Task<HttpResponseMessage> IndexHasChanged()
public Task<HttpResponseMessage> MoreLikeThis()
{
var key = Guid.NewGuid().ToString();
DocumentStore.DatabaseCommands.GetStatistics();
DocumentStore.DatabaseCommands.Put(key, null, new RavenJObject(), new RavenJObject());

SpinWait.SpinUntil(() => DocumentStore.DatabaseCommands.GetStatistics().StaleIndexes.Length == 0);
Expand Down
Expand Up @@ -267,6 +267,7 @@ public HttpResponseMessage IndexHasChanged()
public HttpResponseMessage MoreLikeThis()
{
var key = Guid.NewGuid().ToString();
DocumentStore.DatabaseCommands.GetStatistics();
DocumentStore.DatabaseCommands.Put(key, null, new RavenJObject(), new RavenJObject());

SpinWait.SpinUntil(() => DocumentStore.DatabaseCommands.GetStatistics().StaleIndexes.Length == 0);
Expand Down
2 changes: 1 addition & 1 deletion Raven.Tests.Web/Tests/WebTestBase.cs
Expand Up @@ -26,7 +26,7 @@ protected WebTestBase()
{
client = new HttpClient
{
Timeout = TimeSpan.FromSeconds(20)
Timeout = TimeSpan.FromSeconds(120)
};
}

Expand Down

0 comments on commit 332d39b

Please sign in to comment.