Skip to content
Browse files

Ensure we track the index recreate time correctly

  • Loading branch information...
1 parent 8523bb2 commit 77403a147f900cb373c013d75cc02042788de96c @pranavkm pranavkm committed Aug 27, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 Website/Infrastructure/Lucene/LuceneIndexingService.cs
View
11 Website/Infrastructure/Lucene/LuceneIndexingService.cs
@@ -33,6 +33,9 @@ public void UpdateIndex()
// Reset the lastWriteTime to null. This will allow us to get a fresh copy of all the latest \ latest successful packages
lastWriteTime = null;
+
+ // Set the index create time to now. This would tell us when we last rebuilt the index.
+ UpdateIndexRefreshTime();
}
using (var context = CreateContext())
@@ -176,6 +179,14 @@ protected internal virtual void UpdateLastWriteTime()
}
}
+ protected void UpdateIndexRefreshTime()
+ {
+ if (File.Exists(LuceneCommon.IndexMetadataPath))
+ {
+ File.SetCreationTimeUtc(LuceneCommon.IndexMetadataPath, DateTime.UtcNow);
+ }
+ }
+
internal static IEnumerable<string> TokenizeId(string term)
{

0 comments on commit 77403a1

Please sign in to comment.
Something went wrong with that request. Please try again.