From 5a375954077f2602c36b1e2b0655651622556014 Mon Sep 17 00:00:00 2001 From: Greg Bielleman Date: Fri, 10 Apr 2015 14:56:11 +1000 Subject: [PATCH] Fixes #461 Index needs to exist for cleanup to work --- .../Infrastructure/RavenDB/RavenBootstrapper.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ServiceControl/Infrastructure/RavenDB/RavenBootstrapper.cs b/src/ServiceControl/Infrastructure/RavenDB/RavenBootstrapper.cs index ab568c34fb..27323d98d7 100644 --- a/src/ServiceControl/Infrastructure/RavenDB/RavenBootstrapper.cs +++ b/src/ServiceControl/Infrastructure/RavenDB/RavenBootstrapper.cs @@ -68,7 +68,11 @@ public void Init() documentStore.Initialize(); Logger.Info("Index creation started"); - + + //Create this index synchronously as we are using it straight away + //Should be quick as number of endpoints will always be a small number + documentStore.ExecuteIndex(new KnownEndpointIndex()); + if (Settings.CreateIndexSync) { IndexCreation.CreateIndexes(typeof(RavenBootstrapper).Assembly, documentStore);