adium/adium

Parents 6880c201b832
Children bb8f087a0860
Flush the log index right before searching. If the search starts before the AILoggerPlugin finishes flushing the log, it will appear as if there are no results.

SKIndexFlush is thread-safe, and according to the docs: "Before searching an index, always call SKIndexFlush, even though the flush process may take up to several seconds. If there are no updates to commit, a call to SKIndexFlush does nothing and takes minimal time.", so it will never hurt doing this here.
--- a/Source/AILogViewerWindowController.m Fri Feb 10 23:01:26 2012 +0100
+++ b/Source/AILogViewerWindowController.m Sat Feb 11 00:04:26 2012 +0100
@@ -1571,6 +1571,9 @@
[wildcardedSearchString appendFormat:@"%@ ", searchComponent];
}
+ AILogWithSignature(@"Calling flush");
+ SKIndexFlush(logSearchIndex);
+ AILogWithSignature(@"Done flushing. Now we can search.");
thisSearch = SKSearchCreate(logSearchIndex,
(CFStringRef)wildcardedSearchString,
kSKSearchOptionDefault);