Created
February 6, 2013 15:39
-
-
Save mattburton/4723366 to your computer and use it in GitHub Desktop.
NSB: Disable RavenDB aggressive cachine at startup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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