Created
October 9, 2012 08:01
-
-
Save andreasohlund/3857268 to your computer and use it in GitHub Desktop.
How to clear the NServiceBus inMemory gateway persister periodically
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 DeduplicationCleanup : IWantToRunWhenTheBusStarts | |
| { | |
| public InMemoryPersistence MemoryPersistence { get; set; } | |
| public void Run() | |
| { | |
| Schedule.Every(TimeSpan.FromMinutes(1)) | |
| //delete all ID's older than 30 minutes | |
| .Action(()=> MemoryPersistence.DeleteDeliveredMessages(DateTime.UtcNow.AddMinutes(30))); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment