Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save mattburton/4723366 to your computer and use it in GitHub Desktop.

Select an option

Save mattburton/4723366 to your computer and use it in GitHub Desktop.
NSB: Disable RavenDB aggressive cachine at startup
public class DisableRavenAggressiveCachingForMessageEndpoint : IWantToRunAtStartup
{
public void Run()
{
var documentStoreInterfaceType = Type.GetType("Raven.Client.IDocumentStore, NServiceBus.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c");
if (documentStoreInterfaceType == null)
{
throw new InvalidOperationException("Unable to load internalized IDocumentStore type - check to see if assembly version has changed.");
}
var documentStore = Configure.Instance.Builder.Build(documentStoreInterfaceType);
documentStoreInterfaceType.GetMethod("DisableAggressiveCaching").Invoke(documentStore, null);
}
public void Stop()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment