adium 4679:fceff51f0ad7: Flush the log index right before search...

commits at adium.im commits at adium.im
Fri Feb 10 23:04:58 UTC 2012


details:	http://hg.adium.im/adium/rev/fceff51f0ad7
revision:	4679:fceff51f0ad7
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Sat Feb 11 00:04:26 2012 +0100

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.

diffs (13 lines):

diff -r 6880c201b832 -r fceff51f0ad7 Source/AILogViewerWindowController.m
--- 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);




More information about the commits mailing list